我有深色背景的页面。在 IE、Firefox、Chrome 和 Safari 中,我的复选框如下所示:
但是 Opera 显示这样的复选框:
因此用户无法看到他是否选中了复选框,因为勾号(复选标记)也是黑色的。
这是我的 CSS 的一部分:
body {
background-attachment: fixed;
background-color: #07080A;
background-image: url('images/bg.jpg');
background-position: center top;
background-repeat: no-repeat;
border: 0 none;
color: #FFFFFF;
display: block;
font-family: Arial;
font-size: 13px;
margin: auto auto;
width: 1000px;
}
input, textarea {
width: 300px;
color: #fff;
background-color: #323232;
border: none;
font-size: 13px;
font-family: Arial;
padding: 8px 0px 8px 10px;
}
input[type="checkbox"]{
background: transparent;
width: 30px;
}
我怎样才能改变它?我希望在 Opera 和其他浏览器中具有相同的复选框外观。
最佳答案
尝试使用以下方法覆盖您的第一个样式:
input[type="checkbox"] {
background: inherit;
width: 30px;
}
这将为复选框提供其父级的背景。根据您的规则和其他规则的顺序,您可能需要使用inherit !important
。
关于html - Opera 中的复选框外观,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7903219/