You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<dd>A <relative-size> keyword is interpreted relative to the
475
483
table of font sizes and the font size of the parent element. Possible
476
484
values are: [ larger | smaller ]. For example, if the parent element
@@ -480,24 +488,24 @@ is not close to a table entry, the UA is free to interpolate between
480
488
table entries or round off to the closest one. The UA may have to
481
489
extrapolate table values if the numerical value goes beyond the
482
490
keywords.
483
-
491
+
</dd>
484
492
</dl>
485
493
486
494
<p>Length and percentage values should not take the font size table
487
495
into account when calculating the font size of the element.
488
-
496
+
</p>
489
497
<p>Negative values are not allowed.
490
-
498
+
</p>
491
499
<p>On all other properties, 'em' and 'ex' length values refer to the
492
500
computed font size of the current element. On the 'font-size' property, these
493
501
length units refer to the computed font size of the parent element.
494
-
502
+
</p>
495
503
<p>Note that an application may reinterpret an explicit size,
496
504
depending on the context. E.g., inside a VR scene a font may get a
497
505
different size because of perspective distortion.
498
-
506
+
</p>
499
507
<p>Examples:
500
-
508
+
</p>
501
509
<pre>
502
510
p { font-size: 16px; }
503
511
@media print {
@@ -525,13 +533,13 @@ setting
525
533
sheet. The syntax of this property is based on a traditional
526
534
typographical shorthand notation to set multiple properties related to
527
535
fonts.
528
-
536
+
</p>
529
537
<p>All font-related properties are first reset to their initial values,
530
538
including those listed in the preceding paragraph.
531
539
Then, those properties that are given explicit values in the
532
540
<span class="propinst-font">'font'</span> shorthand are set to those values.
533
541
For a definition of allowed and initial values, see the previously defined properties.
534
-
542
+
</p>
535
543
<pre>
536
544
p { font: 12px/14px sans-serif }
537
545
p { font: 80% sans-serif }
@@ -543,35 +551,35 @@ p { font: normal small-caps 120%/120% fantasy }
543
551
<p>In the second rule, the font size percentage value ('80%') refers
544
552
to the font size of the parent element. In the third rule, the line
545
553
height percentage refers to the font size of the element itself.
546
-
554
+
</p>
547
555
<p>In the first three rules above, the 'font-style', 'font-variant'
548
556
and 'font-weight' are not explicitly mentioned, which means they are
549
557
all three set to their initial value ('normal'). The fourth rule sets
550
558
the 'font-weight' to 'bold', the 'font-style' to 'italic' and
551
559
implicitly sets 'font-variant' to 'normal'.
552
-
560
+
</p>
553
561
<p>The fifth rule sets the 'font-variant' ('small-caps'), the
554
562
'font-size' (120% of the parent's font), the 'line-height' (120% times
555
563
the font size) and the 'font-family' ('fantasy'). It follows that the
556
564
keyword 'normal' applies to the two remaining properties: 'font-style'
557
565
and 'font-weight'.
558
-
566
+
</p>
559
567
<p>The following values refer to <span class="index-def" title="system
560
568
fonts">system fonts</span>:</p>
561
569
562
570
<dl>
563
-
<dt>caption
564
-
<dd>The font used for captioned controls (e.g., buttons, drop-downs, etc.).
565
-
<dt>icon
566
-
<dd>The font used to label icons.
567
-
<dt>menu
568
-
<dd>The font used in menus (e.g., dropdown menus and menu lists).
569
-
<dt>message-box
570
-
<dd>The font used in dialog boxes.
571
-
<dt>small-caption
572
-
<dd>The font used for labeling small controls.
573
-
<dt>status-bar
574
-
<dd>The font used in window status bars.
571
+
<dt>caption</dt>
572
+
<dd>The font used for captioned controls (e.g., buttons, drop-downs, etc.).</dd>
573
+
<dt>icon</dt>
574
+
<dd>The font used to label icons.</dd>
575
+
<dt>menu</dt>
576
+
<dd>The font used in menus (e.g., dropdown menus and menu lists).</dd>
577
+
<dt>message-box</dt>
578
+
<dd>The font used in dialog boxes.</dd>
579
+
<dt>small-caption</dt>
580
+
<dd>The font used for labeling small controls.</dd>
581
+
<dt>status-bar</dt>
582
+
<dd>The font used in window status bars.</dd>
575
583
</dl>
576
584
577
585
<p>System fonts may only be set as a whole; that is, the font
@@ -584,15 +592,14 @@ font), or substitute a user agent default font. As for regular fonts,
584
592
if, for a system font, any of the individual properties are not part
585
593
of the operating system's available user preferences, those properties
586
594
should be set to their initial values.
587
-
595
+
</p>
588
596
<p id="almost">That is why this property is "almost" a shorthand property: system
589
597
fonts can only be specified with this property, not with <span
590
598
class="propinst-font-family">'font-family'</span> itself, so <span
591
599
class="propinst-font">'font'</span> allows authors to do more than the
592
600
sum of its subproperties. However, the individual properties such as <span class="propinst-font-weight">'font-weight'</span> are still given values taken from the system font, which can be independently varied.</p>
0 commit comments