In Css we can genrally style all elements but I noticed that we can not style option
element of a select using CSS. As far as I know Option is child element of select
then what is possible causes that it don't let you style this element?
I've had reffered various answers on stackoverflow stating that You just can't style option. but I want to know exact reason behind it.
I've had reffered this link which says that option tag is rendered by OS and not by html. If so then why we need to specify option
? why it don't automattically render options.
Here is another link which shows how to style Select tag. But i want to know that why we can't style option
? I don't want to know how to style select
tag using CSS.
You cannot style the option
element because it is rendered by the OS, not HTML. That is why it can't be styled via CSS.
You can of course use some plug-in that replaces select
with regular HTML elements that can be styled.
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