All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.w3c.css.properties.CssLineHeight

java.lang.Object
   |
   +----org.w3c.css.properties.CssProperty
           |
           +----org.w3c.css.properties.CssLineHeight

public class CssLineHeight
extends CssProperty

   'line-height'

Value: normal | <number> | <length> | <percentage>
Initial: normal
Applies to: all elements
Inherited: yes
Percentage values: relative to the font size of the element itself

The property sets the distance between two adjacent lines' baselines.

When a numerical value is specified, the line height is given by the font size of the current element multiplied with the numerical value. This differs from a percentage value in the way it inherits: when a numerical value is specified, child elements will inherit the factor itself, not the resultant value (as is the case with percentage and other units).

Negative values are not allowed.

The three rules in the example below have the same resultant line height:

   DIV { line-height: 1.2; font-size: 10pt }     /* number * /
   DIV { line-height: 1.2em; font-size: 10pt }   /* length * /
   DIV { line-height: 120%; font-size: 10pt }    /* percentage * /
 


Constructor Index

 o CssLineHeight()
Create a new CssLineHeight
 o CssLineHeight(CssExpression)
Creates a new CssLineHeight

Method Index

 o addToStyle(CssStyle)
Add this property to the CssStyle.
 o equals(CssProperty)
Compares two properties for equality.
 o get()
Returns the value of this property
 o getPropertyInStyle(CssStyle, boolean)
Get this property in the style.
 o getPropertyName()
Returns the name of this property
 o isDefault()
Is the value of this property is a default value.
 o isSoftlyInherited()
Returns true if this property is "softly" inherited e.g.
 o toString()
Returns a string representation of the object.

Constructors

 o CssLineHeight
 public CssLineHeight()
Create a new CssLineHeight

 o CssLineHeight
 public CssLineHeight(CssExpression expression) throws InvalidParamException
Creates a new CssLineHeight

Parameters:
expression - The expression for this property
Throws: InvalidParamException
The expression is incorrect

Methods

 o get
 public Object get()
Returns the value of this property

Overrides:
get in class CssProperty
 o getPropertyName
 public String getPropertyName()
Returns the name of this property

Overrides:
getPropertyName in class CssProperty
 o isSoftlyInherited
 public boolean isSoftlyInherited()
Returns true if this property is "softly" inherited e.g. his value equals inherit

Overrides:
isSoftlyInherited in class CssProperty
 o toString
 public String toString()
Returns a string representation of the object.

Overrides:
toString in class CssProperty
 o addToStyle
 public void addToStyle(CssStyle style)
Add this property to the CssStyle.

Parameters:
style - The CssStyle
Overrides:
addToStyle in class CssProperty
 o getPropertyInStyle
 public CssProperty getPropertyInStyle(CssStyle style,
                                       boolean resolve)
Get this property in the style.

Parameters:
style - The style where the property is
resolve - if true, resolve the style to find this property
Overrides:
getPropertyInStyle in class CssProperty
 o equals
 public boolean equals(CssProperty property)
Compares two properties for equality.

Parameters:
value - The other property.
Overrides:
equals in class CssProperty
 o isDefault
 public boolean isDefault()
Is the value of this property is a default value. It is used by all macro for the function print

Overrides:
isDefault in class CssProperty

All Packages  Class Hierarchy  This Package  Previous  Next  Index