Relative size with font tag in html: Relative to whom?
Question
<FONT FACE="Comic Sans MS" SIZE=“2“ COLOR="Red">
This is comical and red and small</FONT><BR>
<FONT FACE="Comic Sans" SIZE="+2" COLOR="Red">
This is red and big. Is it comical?</FONT><BR>
<FONT FACE="Comic Sans" SIZE="-2" COLOR="Red">
This is red and big. Is it different?</FONT><BR>
Do the +/- values refer to the first tag or the one preceding the last element?
La solution
It is relative to the size set by the BASEFONT
element (or 3 if no BASEFONT
element is used). From the HTML 4.01 spec:
The
BASEFONT
element sets the base font size (using the size attribute). Font size changes achieved withFONT
are relative to the base font size set byBASEFONT
. IfBASEFONT
is not used, the default base font size is 3.
However, both FONT
and BASEFONT
are deprecated and you should be using CSS instead.
Autres conseils
Relative resizing implies that the font will be resized relative to the default font size in the user's browser settings. However it is not a good programming practice to mix presentation and declaration code. Use CSS instead.