How to Style a Select Dropdown Box Using CSS Only

Last Updated on June 25, 2021 by Roshan Parihar

In this tutorial, learn how to style a select dropdown box in CSS. The short answer is to use the ‘appearance: none‘ CSS property that removes the overall default style including the arrow.

You can also use the CSS property ‘overflow: hidden‘ to change the arrow of the select dropdown box. Let’s find out the different methods to style the select box with the examples given below.

How to Style a Select Dropdown Box in CSS

You can change the background, font size, the color of text, add borders, and other properties to style the select dropdown box using CSS properties. It’s easier to style CSS as given in the example below.

Test it Live

Output

How to Style a Select Dropdown Box Using CSS Only

The above example shows the added background, the color of the text, and the font size of the select box.

However, you cannot change the default with these CSS properties. Let’s find out the below methods to change the default arrow of the select box.

Change Select Dropdown Arrow Using ‘appearance: none’ in CSS

The default select box contains an arrow that shows the dropdown in a form. However, you can change the select dropdown arrow using the CSS property ‘appearance: none‘. It removes the overall style of the select box. After that, you can add your style to the select box as per your requirements.

You can add font awesome icons in place of the select box arrow. After that, you can change the color and font size of the font awesome icon to match it with your select dropdown box.

Test it Live

Output

Change Select Dropdown Arrow Using 'appearance: none' in CSS

The above output shows the changes dropdown arrow and the added font awesome icon to it.

Add Image In Place of Arrow Using ‘overflow: hidden’ in CSS

In addition to the above methods, you can also add the background image in place of the select dropdown arrow using CSS. To add the image in place of the arrow, you have to use the CSS property ‘overflow: hidden‘.

You have to first place the select box within the <div>. After that, add width to the select box and width to the parent element 20px less than the select box. Also, add CSS property ‘overflow: hidden‘ to the div element.

Now, you can add the background image in place of the select box arrow. See the example given below to learn the method.

Test it Live

Output

Add Image In Place of Arrow Using 'overflow: hidden' in CSS

The above examples show the select box with added background image in place of the dropdown arrow. You can add any background image of your choice as per your requirements.

You May Also Like to Read

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.