Is there a way to change the style of just one of the elements select
or option
, without affecting the style of both?
I attempted to align the select
element to the right, while leaving the option
elements aligned to the left. However, this did not work as expected. What should I do?
select {
direction: rtl;
text-align: right;
width: 300px;
}
<select>
<option disabled="disabled" selected="" value="" style="display: none;">Select</option>
<option>option 1</option>
<option>option 2</option>
<option>option 3</option>
</select>