Menu

#13 4.3.3 Percentages

Partially_Completed
open
nobody
Syntax (14)
5
2005-08-10
2005-08-10
Matt
No

The format of a percentage value (denoted by
<percentage> in this specification) is an optional sign
character ('+' or '-', with '+' being the default)
immediately followed by a <number> immediately
followed by '%'.

Percentage values are always relative to another value,
for example a length. Each property that allows
percentages also defines the value to which the
percentage refers. The value may be that of another
property for the same element, a property for an
ancestor element, or a value of the formatting context
(e.g., the width of a containing block). When a
percentage value is set for a property of the root
element and the percentage is defined as referring to
the inherited value of some property, the resultant value
is the percentage times the initial value of that property.

Example(s):

Since child elements (generally) inherit the computed
values of their parent, in the following example, the
children of the P element will inherit a value of 12pt
for 'line-height', not the percentage value (120%):

P { font-size: 10pt }
P { line-height: 120% } /* 120% of 'font-size' */

Discussion

  • Matt

    Matt - 2005-08-10

    Logged In: YES
    user_id=1307954

    The support for percentages is somewhere between 0 and 50
    percent completion. There is some support, but I am unsure
    of how well (or even if) it works.

     
  • Matt

    Matt - 2005-08-10
    • labels: --> Syntax
     

Log in to post a comment.

MongoDB Logo MongoDB