All Packages Class Hierarchy This Package Previous Next Index
Class org.w3c.css.properties.CssVerticalAlign
java.lang.Object
|
+----org.w3c.css.properties.CssProperty
|
+----org.w3c.css.properties.CssVerticalAlign
- public class CssVerticalAlign
- extends CssProperty
- implements CssTextPropertiesConstants
'vertical-align'
Value: baseline | sub | super | top | text-top | middle | bottom
| text-bottom | <percentage>
Initial: baseline
Applies to: inline elements
Inherited: no
Percentage values: refer to the 'line-height' of the element
itself
The property affects the vertical positioning of the element. One set of
keywords is relative to the parent element:
-
'baseline'
-
align the baseline of the element (or the bottom, if the element doesn't
have a baseline) with the baseline of the parent
-
'middle'
-
align the vertical midpoint of the element (typically an image) with the
baseline plus half the x-height of the parent
-
'sub'
-
subscript the element
-
'super'
-
superscript the element
-
'text-top'
-
align the top of the element with the top of the parent element's font
-
'text-bottom'
-
align the bottom of the element with the bottom of the parent element's font
Another set of properties are relative to the formatted line that the element
is a part of:
-
'top'
-
align the top of the element with the tallest element on the line
-
'bottom'
-
align the bottom of the element with the lowest element on the line
Using the 'top' and 'bottom' alignment, unsolvable situations can occur where
element dependencies form a loop.
Percentage values refer to the value of the 'line-height' property of the
element itself. They raise the baseline of the element (or the bottom, if
it has no baseline) the specified amount above the baseline of the parent.
Negative values are possible. E.g., a value of '-100%' will lower the element
so that the baseline of the element ends up where the baseline of the next
line should have been. This allows precise control over the vertical position
of elements (such as images that are used in place of letters) that don't
have a baseline.
It is expected that a future version of CSS will allow <length&t;
as a value on this property.
-
CssVerticalAlign()
- Create a new CssVerticalAlign
-
CssVerticalAlign(CssExpression)
- Create a new CssVerticalAlign
-
addToStyle(CssStyle)
- Add this property to the CssStyle.
-
equals(CssProperty)
- Compares two properties for equality.
-
get()
- Returns the value of this property
-
getPropertyInStyle(CssStyle, boolean)
- Get this property in the style.
-
getPropertyName()
- Returns the name of this property
-
isDefault()
- Is the value of this property is a default value.
-
toString()
- Returns a string representation of the object.
CssVerticalAlign
public CssVerticalAlign()
- Create a new CssVerticalAlign
CssVerticalAlign
public CssVerticalAlign(CssExpression expression) throws InvalidParamException
- Create a new CssVerticalAlign
- Parameters:
- expression - The expression for this property
- Throws: InvalidParamException
- Values are incorrect
get
public Object get()
- Returns the value of this property
- Overrides:
- get in class CssProperty
getPropertyName
public String getPropertyName()
- Returns the name of this property
- Overrides:
- getPropertyName in class CssProperty
toString
public String toString()
- Returns a string representation of the object.
- Overrides:
- toString in class CssProperty
addToStyle
public void addToStyle(CssStyle style)
- Add this property to the CssStyle.
- Parameters:
- style - The CssStyle
- Overrides:
- addToStyle in class CssProperty
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
equals
public boolean equals(CssProperty property)
- Compares two properties for equality.
- Parameters:
- value - The other property.
- Overrides:
- equals in class CssProperty
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