Pages

Sunday, June 15, 2014

How to use the text-decoration and the text-align property?


The text-align CSS property is used to set the horizontal alignment of a text.
Text can be centered, or aligned to the left or right, or justified.
When text-align is set to "justify", each line is stretched so that every line has equal width, and the left and right margins are straight (like in magazines and newspapers).

Example

 h1 {
    text-align: center;
}

p.date {
    text-align: right;
}

p.main {
    text-align: justify;
}

Text Decoration

The text-decoration property is used to set or remove decorations from CSS Text.
The text-decoration property is mostly used to remove underlines from links for design CSS purposes:

 a {
    text-decoration: none;
}

No comments:

Post a Comment