Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drop down arrow in select boxes not showing

Tags:

I am using a wordpress theme and for some reason, the HTML select boxes do not have the drop down area. They look like just plain input text boxes, although when you click on them, you can see the drop down list. I can't find what code might be stripping away the drop down arrows.

This is all I see in the CSS:

input:focus { outline: none; }  select, input, textarea { -webkit-appearance: none; -webkit-border-radius:0;  border-radius:0;  } 
like image 303
JA4677 Avatar asked Jul 14 '15 20:07

JA4677


People also ask

How do you put a down arrow in a select box?

It's simple a matter of stack order. You can use pointer-events: none; so that the dropdown shows dropdown when you click on the arrow.

How do I hide the dropdown arrow in select box?

The dropdown arrow icon in <select> input can be hidden by setting the CSS appearance: none. The CSS appearance property allows to suppress the native appearance of an element (which may vary with operating system), so that CSS can be used to restyle it.

Where is the drop-down arrow on Facebook?

Press and hold the "Alt" key. Press number "2" followed quickly by number "5." Release all keys. This displays a downward-pointing arrow character in your Facebook status or message.


2 Answers

Here is a basic select

<select>    <option>1</option>    <option>2</option>    <option>3</option>  </select>

Now lets see where is your issue:

select {    -webkit-appearance: none;    /*webkit browsers */    -moz-appearance: none;    /*Firefox */    appearance: none;    /* modern browsers */    border-radius: 0;    }
<select>    <option>1</option>    <option>2</option>    <option>3</option>  </select>

So when you set none to appearance you are removing the arrow (which by default is menulist), and when you are setting 0 to border-radius, you are removing the border by default of the select.

NOTE If you have hidden the arrow in IE with this rule select::-ms-expand { display: none; } to have the arrow back you would need to set it display:block

like image 72
dippas Avatar answered Oct 23 '22 18:10

dippas


You have overridden the -webkit-appearance property for select, which was set as -webkit-appearance: menulist; as default value by browsers.

like image 44
dsaket Avatar answered Oct 23 '22 17:10

dsaket