UPDATE
I forgot to fully explain the method underlying my insanity, simply because I was not 100% sure that my decisions would work due to some little-known error that occurs on some Macs on the full moon (as you can say, I'm using a PC and jealous of Mac graphics.)
Thought you had a Mac, I'm bad. Despite this, the solutions work.
When working with fonts and inheritance, we can naturally assume that we have body {font-size:16px;}
, which will be cascaded to other elements, such as a comfortable 16px blanket to everything. Form elements are ignored and do not inherit the default font properties by default. We can fix this as follows:
- Using the
inherit
value, as in the case of patch 1 or ... - ... inherit from the parent, as in fix 2 or ...
- ... just like in the fix file.
There are 3 fixes in this snippet, and one of them, I hope, will work for you.
SNIPPET
html, body { width: 100%; height: 100%; box-sizing: border-box; font: 600 16px/1 Verdana; } * { margin: 0; padding: 0; line-height: 1; } fieldset { padding: 10px; margin: 50px auto; } legend { text-align: right; } select { width: 6ex; } select#X { font-size: 2em; } select#X > option { font-size: inherit; } select#Y { font-size: 200%; } select#Y > option { font-size: 100%; } select#Z { font-size: 32px; } select#Z > option { font-size: 32px; }
<fieldset> <legend> <h1>Font-size</h1> <h2>Select<br> Option</h2> </legend> <select id='X' name='X'> <option value="X">X</option> <option value="1">2em</option> <option value="2">inherit</option> </select> <select id='Y' name='Y'> <option value="Y">Y</option> <option value="1">200%</option> <option value="2">100%</option> </select> <select id='Z' name='Z'> <option value="Z">Z</option> <option value="1">32px</option> <option value="2">32px</option> </select> </fieldset>
source share