Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 单选按钮在PC上是圆形的,但在手机上是方形的_Html_Css - Fatal编程技术网

Html 单选按钮在PC上是圆形的,但在手机上是方形的

Html 单选按钮在PC上是圆形的,但在手机上是方形的,html,css,Html,Css,我编写了一些简单的单选按钮(没有样式) 成人 小狗(1岁以下) 在pc机上,它们显示为普通圆圈,但在移动设备上,它们显示为普通圆圈,我如何才能改变这一点? 您可以进行自定义 简单例子 <!DOCTYPE html> <html> <style> /* The container */ .container { display: block; position: relative; padding-left: 35px; margin-bott

我编写了一些简单的单选按钮(没有样式)

成人
小狗(1岁以下)
在pc机上,它们显示为普通圆圈,但在移动设备上,它们显示为普通圆圈,我如何才能改变这一点?
您可以进行自定义

简单例子

<!DOCTYPE html>
<html>
<style>
/* The container */
.container {
  display: block;
  position: relative;
  padding-left: 35px;
  margin-bottom: 12px;
  cursor: pointer;
  font-size: 22px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Hide the browser's default radio button */
.container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

/* Create a custom radio button */
.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 25px;
  width: 25px;
  background-color: #eee;
  border-radius: 50%;
}

/* On mouse-over, add a grey background color */
.container:hover input ~ .checkmark {
  background-color: #ccc;
}

/* When the radio button is checked, add a blue background */
.container input:checked ~ .checkmark {
  background-color: #2196F3;
}

/* Create the indicator (the dot/circle - hidden when not checked) */
.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

/* Show the indicator (dot/circle) when checked */
.container input:checked ~ .checkmark:after {
  display: block;
}

/* Style the indicator (dot/circle) */
.container .checkmark:after {
    top: 9px;
    left: 9px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}
</style>
<body>

<h1>Custom Radio Buttons</h1>
<label class="container">One
  <input type="radio" checked="checked" name="radio">
  <span class="checkmark"></span>
</label>
<label class="container">Two
  <input type="radio" name="radio">
  <span class="checkmark"></span>
</label>
<label class="container">Three
  <input type="radio" name="radio">
  <span class="checkmark"></span>
</label>
<label class="container">Four
  <input type="radio" name="radio">
  <span class="checkmark"></span>
</label>

</body>
</html>


/*容器*/
.集装箱{
显示:块;
位置:相对位置;
左侧填充:35px;
边缘底部:12px;
光标:指针;
字体大小:22px;
-webkit用户选择:无;
-moz用户选择:无;
-ms用户选择:无;
用户选择:无;
}
/*隐藏浏览器的默认单选按钮*/
.容器输入{
位置:绝对位置;
不透明度:0;
光标:指针;
}
/*创建自定义单选按钮*/
.对号{
位置:绝对位置;
排名:0;
左:0;
高度:25px;
宽度:25px;
背景色:#eee;
边界半径:50%;
}
/*在鼠标悬停时,添加灰色背景色*/
.container:悬停输入~。选中标记{
背景色:#ccc;
}
/*选中单选按钮后,添加蓝色背景*/
.container输入:选中~.checkmark{
背景色:#2196F3;
}
/*创建指示器(点/圆-未选中时隐藏)*/
.勾选:之后{
内容:“;
位置:绝对位置;
显示:无;
}
/*选中时显示指示器(点/圆)*/
.容器输入:选中~。选中标记:之后{
显示:块;
}
/*设置指示器的样式(点/圆)*/
.容器。选中标记:之后{
顶部:9px;
左:9px;
宽度:8px;
高度:8px;
边界半径:50%;
背景:白色;
}
自定义单选按钮
一个
两个
三
四

它们是真正的复选框还是方形单选按钮?很明显,您在图像中应用了一些CSS,但您提供的代码中没有任何CSS。你需要提供一个新的解决方案。“移动”不是一个有用的描述:什么浏览器?什么操作系统?iPhone上的Safari,我现在进一步定制了按钮,它们显示圆形。谢谢你!请答案是“仅仅是一个链接到一个外部网站”。谢谢!我是盲人,在我研究这个时没有看到这个链接
<!DOCTYPE html>
<html>
<style>
/* The container */
.container {
  display: block;
  position: relative;
  padding-left: 35px;
  margin-bottom: 12px;
  cursor: pointer;
  font-size: 22px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Hide the browser's default radio button */
.container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

/* Create a custom radio button */
.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 25px;
  width: 25px;
  background-color: #eee;
  border-radius: 50%;
}

/* On mouse-over, add a grey background color */
.container:hover input ~ .checkmark {
  background-color: #ccc;
}

/* When the radio button is checked, add a blue background */
.container input:checked ~ .checkmark {
  background-color: #2196F3;
}

/* Create the indicator (the dot/circle - hidden when not checked) */
.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

/* Show the indicator (dot/circle) when checked */
.container input:checked ~ .checkmark:after {
  display: block;
}

/* Style the indicator (dot/circle) */
.container .checkmark:after {
    top: 9px;
    left: 9px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}
</style>
<body>

<h1>Custom Radio Buttons</h1>
<label class="container">One
  <input type="radio" checked="checked" name="radio">
  <span class="checkmark"></span>
</label>
<label class="container">Two
  <input type="radio" name="radio">
  <span class="checkmark"></span>
</label>
<label class="container">Three
  <input type="radio" name="radio">
  <span class="checkmark"></span>
</label>
<label class="container">Four
  <input type="radio" name="radio">
  <span class="checkmark"></span>
</label>

</body>
</html>