Select element with four options, when I move the mouse over each of the first three options the option changes from black text on white background to white text on blue background, as expected. However, when I move the mouse over the last option its appearance does not change.
If I use a select with only three options, the last element is highlighted white on blue as expected.
You can use inline styles to add custome styling to <option> tags. For eg : <option style="font-weight:bold;color:#09C;">Option 1</option> This will apply the styles to this particular <option> element only.
You can use the user-select property to disable text selection of an element. In web browsers, if you double-click on some text it will be selected/highlighted. This property can be used to prevent this.
The <select> element is used to create a drop-down list. The <select> element is most often used in a form, to collect user input. The name attribute is needed to reference the form data after the form is submitted (if you omit the name attribute, no data from the drop-down list will be submitted).
The <mark> tag defines text that should be marked or highlighted.
This issue is know and blogged about on frankcode. The following workarounds exist:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With