All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.w3c.css.properties.CssDisplay

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

public class CssDisplay
extends CssProperty

   'display'

Value: block | inline | list-item | none
Initial: block
Applies to: all elements
Inherited: no
Percentage values: N/A

This property describes how/if an element is displayed on the canvas (which may be on a printed page, a computer display etc.).

An element with a 'display' value of 'block' opens a new box. The box is positioned relative to adjacent boxes according to the CSS formatting model. Typically, elements like 'H1' and 'P' are of type 'block'. A value of 'list-item' is similar to 'block' except that a list-item marker is added. In HTML, 'LI' will typically have this value.

An element with a 'display' value of 'inline' results in a new inline box on the same line as the previous content. The box is dimensioned according to the formatted size of the content. If the content is text, it may span several lines, and there will be a box on each line. The margin, border and padding properties apply to 'inline' elements, but will not have any effect at the line breaks.

A value of 'none' turns off the display of the element, including children elements and the surrounding box.

   P { display: block }
   EM { display: inline }
   LI { display: list-item }
   IMG { display: none }
 

The last rule turns off the display of images.

The initial value of 'display' is 'block', but a UA will typically have default values for all HTML elements according to the suggested rendering of elements in the HTML specification.


Constructor Index

 o CssDisplay()
Create a new CssDisplay
 o CssDisplay(CssExpression)
Create a new CssDisplay

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 CssDisplay
 public CssDisplay()
Create a new CssDisplay

 o CssDisplay
 public CssDisplay(CssExpression expression) throws InvalidParamException
Create a new CssDisplay

Parameters:
expression - The expression for this property
Throws: InvalidParamException
Values are incorect

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