Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change color and appearance of drop down arrow

I want to change the default appearance of the arrow of a dropdown list so that looks the same across browsers. Is there a way to override the default look and feel of the drop down arrow using CSS or otherwise ?

like image 844
Iris Avatar asked Mar 04 '09 16:03

Iris


People also ask

How do you change the arrow color on a select box?

Attach Inspector, press Ctrl+Shift+LMB on that arrow and you'll see what you should change.

Where is the Styles drop-down arrow?

In the Styles group on the Home tab, click the More drop-down arrow. Select the desired style from the drop-down menu. The text will appear in the selected style.


1 Answers

You can acheive this with CSS but you are not techinically changing the arrow itself.

In this example I am actually hiding the default arrow and displaying my own arrow instead.

.styleSelect select {    background: transparent;    width: 168px;    padding: 5px;    font-size: 16px;    line-height: 1;    border: 0;    border-radius: 0;    height: 34px;    -webkit-appearance: none;    -moz-appearance: none;    appearance: none;    color: #000;  }    .styleSelect {    width: 140px;    height: 34px;    overflow: hidden;    background: url("images/downArrow.png") no-repeat right #fff;    border: 2px solid #000;  }
<div class="styleSelect">    <select class="units">      <option value="Metres">Metres</option>      <option value="Feet">Feet</option>      <option value="Fathoms">Fathoms</option>    </select>  </div>
like image 179
Sphvn Avatar answered Oct 14 '22 19:10

Sphvn