Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

change the height of "option" only with css

Tags:

html

css

For example,in the code,"option"is too low,I want to make it higher only with css(no javascript).

<select>
    <option>Beijing</option>
    <option>ShangHai</option>
    <option>WuHan</option>
  </select>
like image 638
王晨阳 Avatar asked Sep 01 '25 06:09

王晨阳


1 Answers

Since <option> (and <select>) elements are rendered by the browser as a dropdown list, unfortunately you cannot style them, because their style is only controlled by the browser itself.

like image 83
Marco Bonelli Avatar answered Sep 02 '25 21:09

Marco Bonelli