Interview Questions

What is the percentage value in 'font-size' relative to?

CSS Interview Questions and Questions


(Continued from previous question...)

91. What is the percentage value in 'font-size' relative to?

It is relative to the parent element's font-size. For example, if the style sheet says:

H1 {font-size: 20pt;}
SUP {font-size: 80%;}

...then a <SUP> inside an <H1> will have a font-size of 80% times 20pt, or 16pt.

(Continued on next question...)

Other Interview Questions