How to style drop down list?
This question already has an answer here:
Check this out - http://bavotasan.com/2011/style-select-box-using-only-css/
html
<div class="styled-select">
<select>
<option>Here is the first option</option>
<option>The second option</option>
</select>
</div>
css
.styled-select select {
background: transparent;
width: 268px;
padding: 5px;
font-size: 16px;
line-height: 1;
border: 0;
border-radius: 0;
height: 34px;
-webkit-appearance: none;
}
For more elaborate styling you need to use javascript - like this http://tympanus.net/codrops/2012/10/04/custom-drop-down-list-styling/
If what you mean is "How can I style the selectable options in a form element?", then you're gonna have a hard time. You cannot use pure CSS to achieve that. You could create an "
上一篇: 为什么我们不能使用CSS设计下拉式选项?
下一篇: 如何样式下拉列表?