【发布时间】:2017-04-18 17:30:27
【问题描述】:
这些是我的选择标签在 IE 和 Firefox 中的屏幕截图:
如何让它在每个浏览器中看起来都一样?
css代码为:
select{
width:10%;
margin:0;
padding:0;
box-sizing: border-box;
border: 2px solid #ccc;
border-radius: 0px 4px 4px 0px;
font-size: 16px;
background-color: white;
padding: 13px 0px 14px 10px;
background-color: lightblue;
color:#333;
margin-left: -7px;
}
更新: 这个新的自定义选择下拉菜单在 Mozilla 和 chrome 中运行良好 选择#城市{ -webkit 外观:无; /移除默认的 Chrome 和 SAFARI 风格/ -moz 外观:无; /移除默认的 Firefox 样式/
color: #fff;
border-top: 2px solid #ccc;
border-right: 2px solid #ccc;
border-bottom: 2px solid #ccc;
border-radius: 0px 4px 4px 0px;
-webkit-border-radius: 0px 4px 4px 0px;
font-size: 13px;
/* padding For Mozilla*/
padding: 15px 0px 14px 2px;
/* padding for chrome */
-webkit-padding-before:15px;
-webkit-padding-end:0px;
-webkit-padding-after:13px !important;
-webkit-padding-start:5px;
width: 10%;
cursor: pointer;
margin-left: -7px !important;
background: #0d98e8 url(https://cdn1.iconfinder.com/data/icons/universal-icons-set-for-web-and-mobile/100/controls_0-12-512.png) no-repeat right center;
background-size: 40px 37px; /*TO ACCOUNT FOR @2X IMAGE FOR RETINA */
box-sizing: border-box;
}
select#city option {
background-color:#fff;
color:black;
}
select::-ms-expand{
display:none;
}
【问题讨论】:
-
每个浏览器都以自己的方式处理输入控件。您仍然可以尝试使其保持一致。
-
我做了所有可能的事情(据我所知)
-
看我的回答@Mps
标签: css