CSS -Vertical-Align- Eigenschaft
Beispiel
Bild vertikal ausrichten:
img.a {
vertical-align: baseline;
}
img.b {
vertical-align: text-top;
}
img.c {
vertical-align: text-bottom;
}
img.d {
vertical-align: sub;
}
img.e {
vertical-align: super;
}
Definition und Verwendung
Die vertical-align
Eigenschaft legt die vertikale Ausrichtung eines Elements fest.
Standardwert: | Grundlinie |
---|---|
Vererbt: | Nein |
Animierbar: | ja. Lesen Sie mehr über animierbare |
Ausführung: | CSS1 |
JavaScript-Syntax: | Objekt .style.verticalAlign="oben" |
Browser-Unterstützung
Die Zahlen in der Tabelle geben die erste Browserversion an, die die Eigenschaft vollständig unterstützt.
Property | |||||
---|---|---|---|---|---|
vertical-align | 1.0 | 4.0 | 1.0 | 1.0 | 4.0 |
CSS-Syntax
vertical-align: baseline|length|sub|super|top|text-top|middle|bottom|text-bottom|initial|inherit;
Eigenschaftswerte
Value | Description | Play it |
---|---|---|
baseline | The element is aligned with the baseline of the parent. This is default | |
length | Raises or lower an element by the specified length. Negative values are allowed. Read about length units | |
% | Raises or lower an element by a percent of the "line-height" property. Negative values are allowed | |
sub | The element is aligned with the subscript baseline of the parent | |
super | The element is aligned with the superscript baseline of the parent | |
top | The element is aligned with the top of the tallest element on the line | |
text-top | The element is aligned with the top of the parent element's font | |
middle | The element is placed in the middle of the parent element | |
bottom | The element is aligned with the lowest element on the line | |
text-bottom | The element is aligned with the bottom of the parent element's font | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
Verwandte Seiten
CSS-Tutorial: CSS-Text
HTML-DOM-Referenz: Eigenschaft verticalAlign