How to make font-size less for 2px than parent element?
I have two
<span>s. First is
font-size: 14px; and I want to reduce
font-size of child
<span>14px font <span>12px span</span></span>
How to do this without obvious setting
font-size: 12px;? Is it possible with CSS? Or should I use jQuery?
jsFiddle, of course.
If you don't mind using a feature with less than full support, I believe you could use CSS3's calc() For example:
font-size: calc(100% - 2px);
According to the spec the spaces around the operator are necessary.
calc(100%-2px) may not work.