简体   繁体   English

删除选择标签上的边框

[英]Removing the border on select tag

I made a form for a site and all textboxes have rounded corners except the select drop down box. 我为站点创建了一个表单,除选择下拉框外,所有文本框均具有圆角。 I made a rounded box style and it shows but the original square also shows behind it. 我制作了一个圆形框样式,它显示了,但是原始正方形也显示在它的后面。 Is there any way I can remove this so my is the only one that shows. 有什么方法可以删除此内容,所以我是唯一显示的内容。 I'll add the code 我将添加代码

<td>Service Requested:
      <select style="margin-left: 10px" name="service" tabindex="4">
           <option value=" " selected="selected"> </option>
           <option value="Residential Move">Residential Move*</option>
           <option value="Commercial Move">Commercial Move*</option>
           <option value="Storage Unit Loading">Storage Unit Loading</option>
           <option value="Storage Unit Unloading">Storage Unit Unloading</option>
           <option value="Furniture Consignment">Furniture Consignment</option>
           <option value="Assembly/Removal">Assembly/Removal</option>
           <option value="Landscaping">Landscaping</option>
           <option value="Cleanout">Cleanout</option>
           <option value="General Help">General Help</option>
      </select>
</td>        

and this is the entire css for the whole form. 这是整个表单的整个CSS。 Just have at it 只是拥有它

#searchbox {
padding-left: 190px;
padding-bottom:40px;
background: url(../images/border-dashed.gif) repeat-x left bottom;
}

#searchbox form {
margin: 0;
}

#searchbox table {
margin: 0;
}

#searchbox th, td {
text-align: left;
font-weight: normal;
color:#302f2f;
}

#searchbox .submitrow {
text-align: right;
}

#search {

}

#search input[type="text"] {
   border: 2px solid #c1c2c3 ;
   font: bold 12px Arial,Helvetica,Sans-serif;
   color: #302f2f;
   width: 100px;
   padding: 6px 15px 6px 15px;
   -webkit-border-radius: 20px;
   -moz-border-radius: 20px;
   border-radius: 20px;
   text-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
   -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
   -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
   box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
   -webkit-transition: all 0.7s ease 0s;
   -moz-transition: all 0.7s ease 0s;
   -o-transition: all 0.7s ease 0s;
   transition: all 0.7s ease 0s;
}

#search input[type="text"]:focus {
   width: 150px;
}

#search select {
    border: 2px solid #c1c2c3 ;
    font: bold 12px Arial,Helvetica,Sans-serif;
    color: #302f2f;
    width: 200px;
    padding: 6px 15px 6px 15px;
    -webkit-border-radius: 20px;
    -moz-border-radius: 20px;
    border-radius: 20px;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
    -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
    -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
    -webkit-transition: all 0.7s ease 0s;
    -moz-transition: all 0.7s ease 0s;
    -o-transition: all 0.7s ease 0s;
    transition: all 0.7s ease 0s;
}

#search select:focus {
    width: 250px;
}

#search textarea {
    border: 2px solid #c1c2c3 ;
    font: bold 12px Arial,Helvetica,Sans-serif;
    color: #302f2f;
    width: 300px;
    padding: 6px 15px 6px 15px;
    -webkit-border-radius: 20px;
    -moz-border-radius: 20px;
    border-radius: 20px;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
    -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
    -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) inset;
    -webkit-transition: all 0.7s ease 0s;
    -moz-transition: all 0.7s ease 0s;
    -o-transition: all 0.7s ease 0s;
    transition: all 0.7s ease 0s;
}

#search textarea:focus {

}


.contactwrapper {width:auto; height:200px; overflow:hidden;}
.extra-wrap {width:800px; overflow:hidden;}




.formbtn {
background: url(../images/formbtns.png) no-repeat;
background-position: 0 bottom;
color: #f1f2ea;
display: block;
line-height: 28px;
float:right;
margin-left:450px;
margin-bottom:40px;
height: 30px;
width: 100px;
margin: 48px 10px;
outline: 0;
text-align: center;
text-decoration: none;
}
.formbtn:hover {
background-position: 0 top;
}

thanks 谢谢

The ability to style select boxes is inconsistent across browsers. 跨浏览器为选择框设置样式的能力不一致。 Some of them respond well to CSS styling and some don't, but if you really want to have completely consistent control over it and its behavior, you need to make a faux-select that is powered by javascript. 他们中的一些人对CSS样式的反应很好,而有些则不能,但是,如果您真的想要对其样式及其行为进行完全一致的控制,则需要进行基于javascript的仿选择。

Check out the Select2 control , it's nice. Select2控件 ,很好。

Styling to a select box is chosen mostly by the browser and is not very customizable without javascript besides using a background image. 选择框的样式大部分是由浏览器选择的,除了使用背景图片之外,如果没有javascript,就很难自定义。

Since jQuery UI 1.8 there has been an autocomplete control that has a combobox functionality which replaces a select control. 从jQuery UI 1.8开始,已经出现了具有填充框功能的自动完成控件,该功能可替换选择控件。

I found an alternative, but not sure how it will behave with all browsers. 我找到了替代方法,但不确定如何在所有浏览器中使用。 But if you change the border property to inherit it will do it. 但是,如果您将border属性更改为继承,它将执行此操作。 At least in Chrome 至少在Chrome中

border: 2px inherit #c1c2c3 ; border:2px继承#c1c2c3;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM