W3C CSS logo Cascading Style Sheets FAQ

home CSS FAQ parent Questions about percentages

2.1. What is the percentage 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%}

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

There was some confusion over this issue, since Microsoft's Internet Explorer version 3 had an erroneous implementation of percentage values in SUP elements: the percentages was computed over the default size of the SUP, not over the inherited size. [Information provided by Braden N. McDaniel <braden@shadow.net>]


W3C Bert Bos
Webmaster
Last updated 6 Jan 1997