HTML and CSS Reference
In-Depth Information
To add multiple decorations, separate the values with spaces (indicated by the “ +
sign, shown previously). The following rule adds a line above and below text content that
is affected by this class:
.highlight { text-decoration: underline overline; }
This property does not inherit, but its effect renders across descendent inline
elements in a way that is similar to inheritance.
The first line of text in a block element can be indented with the text-indent property.
It can be set to a unit of measure or a percentage of the parent element's width. Text can
also be indented backward by using a negative value.
text-indent (block) : inherit | <length> | <percentage>
The following example indents the first line of paragraph elements by one em:
p { text-indent: 1em; }
The text content of a block element can be aligned with the text-align property. This
property can replace usages of the deprecated align attribute in HTML.
text-align (block) : inherit | left | center | right | justify
Text and inline elements can be aligned to the left, aligned to the right, or centered.
The justify value also stretches each line so that both the right and left margins appear
p { text-align: justify; }
The text-align property inherits, so it needs to be explicitly changed in child
elements to restore default left alignment.
The writing direction of text can be switched with the direction property.
direction (block) : inherit | ltr | rtl
Search WWH ::

Custom Search