gpt4 book ai didi

html - 边框样式在 Internet Explorer 11 中不起作用

转载 作者:行者123 更新时间:2023-11-28 19:29:21 24 4
gpt4 key购买 nike

我创建了一个在 IE 浏览器中不工作的切换按钮。我对 web-kit 外观和边框有疑问。

这是我的代码的工作片段:

.contain {
position: relative;
display: inline-block;
width: 48px;
height: 24px;
background: #d6d6d6;
border-radius: 20px;
margin: 10px;
}

.checkbox {
position: absolute;
width: 28px;
height: 28px;
-webkit-appearance: none;
background: white;
border: 1px solid;
border-radius: 50%;
top: -5px;
left: -10px;
outline: none;
}

.checkbox:checked {
left: 20px;
}
 <label class="contain" >
<input type="checkbox" id="checkbox" class="checkbox" />
</label>

边框在 Chrome 中没问题,但在 Internet-Explorer 中不应用边框半径。

最佳答案

问题似乎出在 .checkbox 元素上,您没有为其指定边框颜色,这可能就是您看不到边框的原因。

您可以将它添加到 border 属性的末尾,如下所示:

.checkbox {
width: 28px;
height: 28px;
position: absolute;
top: -5px;
left: -10px;
-webkit-appearance: none;
border: 1px solid red;
border-radius: 50%;
outline: none;
background: white
}

或者您可以将 border 属性拆分为 border-widthborder-styleborder-color属性,像这样:

.checkbox {
width: 28px;
height: 28px;
position: absolute;
top: -5px;
left: -10px;
-webkit-appearance: none;
border-width: 1px;
border-style: solid;
border-color: red;
border-radius: 50%;
outline: none;
background: white
}

您可以尝试做的另一件事是通过将边框的宽度 (1px) 更改为 2px/3px 来使边框变粗。

祝你好运。

关于html - 边框样式在 Internet Explorer 11 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55397024/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com