以下css文件可以很好地为文本字段提供背景颜色和边框,但不提供选择框的边框。
.fieldSClsErr {
font: normal 0.75em Arial, Helvetica, sans-serif;
padding: 0 1px 0 0;
color:black;
line-height:120%;
width:200px;
height:18px;
border:1px solid #b3b3b3;
border-color: red red red red;
background-color:#fffff0;
vertical-align: middle;
margin:0px;
}
如何修改此css代码以便在选择框周围显示边框?
答案 0 :(得分:1)
试试这个http://jsfiddle.net/thiswolf/2Wyyj/
<select class="fieldSClsErr" style="width: 80%;">
<option value="Sal">Sal</option>
<option value="Awesome">Awesome!</option>
</select>
<input class="fieldSClsErr" type="text" />
CSS
.fieldSClsErr{
display:inline-block;
font: normal 0.75em Arial, Helvetica, sans-serif;
padding: 0 1px 0 0;
color:black;
line-height:120%;
width:200px;
height:18px;
border: 2px solid red !important;
background-color:#fffff0;
vertical-align: middle;
margin:0px;
margin-bottom:10px !important;
}
答案 1 :(得分:0)
您的border语法错误:
- border:1px solid #b3b3b3;
- border-color: red red red red;
+ border: red 1px solid;