There must be an answer to this, but after trying all so many, nothing seams to work on Chrome or Firefox, so, would you kindly offer a working solution using simple css / scss for controlling the spaces between <option>
elements inside <select>
drop-box. No matter what I try, each item has some top/bottom padding or margins and I am unable to get rid of it.
I am trying to have tiny, compact drop-box with tiny items with no spaces at all between any of them, so they are directly one below each other.
To be clear, I am looking for eliminating spaces between the individual <option>
items (not for the main <select>
box).
select {
line-height: 9px;
font-size: 8px;
padding: 0px;
margin: 0px;
}
option {
line-height: 9px;
font-size: 8px;
padding-top: -4px;
padding-bottom: -4px;
margin-top: -4px;
margin-bottom: -4px;
text-indent: -4px;
}
<div>
<select>
<option>Test1</option>
<option>Test2</option>
<option>Test3</option>
<option>Test4</option>
</select>
</div>
I am constantly getting:
But hoping for:
EDIT:
The above snippet appears on Firefox about what I want, BUT not on Chrome. Chrome keeps it with the spaces between. If you have an answer for Chrome, would be grateful.