All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.w3c.css.properties.CssWidth

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

public class CssWidth
extends CssProperty

   'width'

Value: <length> | <percentage> | auto
Initial: auto
Applies to: block-level and replaced elements
Inherited: no
Percentage values: refer to parent element's width

This property can be applied to text elements, but it is most useful with replaced elements such as images. The width is to be enforced by scaling the image if necessary. When scaling, the aspect ratio of the image is preserved if the 'height' property is 'auto'.

Example:

   IMG.icon { width: 100px }
 

If the 'width' and 'height' of a replaced element are both 'auto', these properties will be set to the intrinsic dimensions of the element.

Negative values are not allowed.


Constructor Index

 o CssWidth()
Create a new CssWidth
 o CssWidth(CssExpression)
Create a new CssWidth.

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

 o CssWidth
 public CssWidth(CssExpression expression) throws InvalidParamException
Create a new CssWidth.

Parameters:
expression - The expression for this property
Throws: InvalidParamException
Values are 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