select控件样式(兼容IE6、IE7、Firefox 2.0)

<div class="form-file-box">
        <div class="select mr10">
                  <div>
                          <select name="ddlSheng" id="ddlSheng" style="width: 127px; font-family: 微软雅黑;" class="">
<option selected="selected" value="0">---请选择---</option>
<option value="安徽">安徽</option>

</select>
                     </div>
            </div>

 </div>


css样式:

.select * {
  margin: 0;
  padding: 0;
}
.select {
  border:1px solid #c5c5c5;
  border-bottom: 1px solid #d9d9d9;
  float: left;
  height:25px;
  display: inline;
  padding-top:5px;
  /*
  margin-top:0;
  margin-top:1px \9;
  margin-top:1px;
  _margin-top:1px;**/
  background-color:#fff;
  font-family:"微软雅黑","Microsoft YaHei";
  }
.select.focus{
    border:1px solid #fd5e5e !important;
}
.select div {
  float: left;
  *height:19px
}
/* 子选择器,在FF等非IE浏览器中识别 */
.select>div {
  height: 19px;
  overflow:hidden;
  }
/* 通配选择符,只在IE浏览器中识别 */
* html .select div select {
  display:block;
  float: left;
  margin: -2px;
  height:29px;
}
.select div>select {
  display:block;
  float:none;
  margin:-2px;
  padding: 0px;
  height:25px;
}
.select:hover {
  border:1px solid #d1d1d1; /*鼠标移上的效果*/
}
.select select>option {
  text-indent: 2px; /*option在FF等非IE浏览器缩进2px*/
  font-family:"微软雅黑","Microsoft YaHei";
}

猜你喜欢

转载自blog.csdn.net/github_39051926/article/details/77884193