Opera 中的复选框外观
我有深色背景的页面。在 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 和其他浏览器中具有相同的复选框外观。
I have page with dark background. In IE, Firefox, Chrome and Safari my checkboxes looks like this:
But Opera displays checkboxes like this:
So user cannot see if he checked the checkbox, because the tick (check-mark) is black as well.
Here is part of my 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;
}
How can I change that? I would like to have appearance of checkbox the same in Opera and other browsers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
尝试使用以下方法覆盖您的第一个样式:
这将为复选框提供其父级的背景。根据您的规则和其他规则的顺序,您可能需要使用
inherit !important
。Try to override your first style using:
This will give the checkbox the background of its parent. Depending on the order of your rules and other rules, you might need to use
inherit !important
.在 Opera 中,背景属性适用于复选框内的背景,而不是复选框外的背景。我相信您要解决的问题是您可以 在此页面上查找有关如何设置复选框样式的信息。
In Opera, the background property applies to the background inside the checkbox not the background outside of the checkbox. I believe what you're trying to fix is some of the issues that you can find on this page about how checkboxes are styled.
这对你不起作用吗?
Does that not work for you?
首先,您的 input[type="checkbox"] 行中有一个拼写错误。
其次,根据 this 您可以明确将复选框背景设置为白色。这在 Opera 中有效。
First, you have a typo in your input[type="checkbox"] line.
Second, according to this you could explicitly set the checkbox background to be white. This works in Opera.