I was wondering why is <select>
element different color on few web pages. I noticed that on some pages if there is font-family:inherit
css property affecting the select element, it would look different - blue!
<!-- BLACK -->
<select>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="opel">Opel</option>
<option value="audi">Audi</option>
</select>
<!-- BLUE -->
<select style="font-family: inherit;">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="opel">Opel</option>
<option value="audi">Audi</option>
</select>
I understand frontend development, and I know about normalize/reset. I am wondering why is font-family:inherit
affecting color of a <select>
Does anyone know why is it so? What is the default value (i.e. inherit) value for the font-family?
Screenshot showing js fiddle result on mac
EDIT:
Tony posted a screenshot in comments, font-family: system-ui;
is affecting look and feel of <select>
.
EDIT 2:
Apparently it is a trend in web design to leave decision on font family to the device - so called native fonts. Therefore forms are also respecting directive and end up rendered as native UI elements.