html - Opera 中的复选框外观

标签 html css cross-browser

我有深色背景的页面。在 IE、Firefox、Chrome 和 Safari 中,我的复选框如下所示: enter image description here

但是 Opera 显示这样的复选框:

enter image description here

因此用户无法看到他是否选中了复选框,因为勾号(复选标记)也是黑色的。

这是我的 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/

相关文章:

javascript - 元素边框上的html鼠标悬停事件

html - 如何让网页记住上次打开的文件目录?

javascript - 区分 0 和 ""

jquery - 如何更改将鼠标悬停在图像上时显示的图像部分?

javascript - PHP 和 CSS 的这一部分需要 JavaScript 吗?或者单独用css可以吗?

javascript - 如何检查客户端是否下载了js文件

html - 为什么元描述标签未显示在 Google 上

css - 是否可以在 CSS 中制作这样的对 Angular 线细条纹?

css - 为什么我们在normalize.css中加入这行代码?

javascript - 哪些浏览器在缓存 XMLHTTPRequest 响应时有问题?