Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change the Option height of dropdown

Tags:

javascript

css

Is that possible to change height between two options using CSS?

See the illustrative ex. Height between Cash & Credit Card option

enter image description here

Note: I am supporting Chrome only

like image 908
Niks Jain Avatar asked Nov 05 '12 11:11

Niks Jain


People also ask

How do I increase dropdown height in CSS?

You just need to use the height CSS attribute for the select tag. Show activity on this post. Notice that you have to remove the "." before select and option. This will overwrite any select and option element.

How do you increase the size of a drop down menu in HTML?

Create a css and set the value style="width:50px;" in css code. Call the class of CSS in the drop down list. Then it will work.


1 Answers

Does no one remember <optgroup>s anymore? Rarely used, but nonetheless supported in every browser.

<select>
  <optgroup label="Cash">
    <option>Cash</option>
  </optgroup>
  <optgroup label="Other">
    <option>Credit Card</option>
    <option>Credit Note (R)</option>
    <option>Gift Voucher</option>
    <option>Cheque</option>
  </optgroup>
</select>
like image 139
Sebastian Simon Avatar answered Sep 30 '22 02:09

Sebastian Simon