The text-transform property is used to specify uppercase and lowercase letters in a text. It can be used to turn everything into uppercase or lowercase letters, or capitalize the first letter of each word.
Text Indentation
The text-indentation property is used to specify the indentation of the first line of a text. Example p {text-indent:50px;}
Links in CSS
Links can be styled in different ways.
Styling Links
Links can be styled with any CSS property (e.g. color, font-family, background, etc.). Special for links are that they can be styled differently depending on what state they are in.
The four links states are:
· a:link - a normal, unvisited link
· a:visited - a link the user has visited
· a:hover - a link when the user mouses over it
· a:active - a link the moment it is clicked
Example
a:link {color:#FF0000;} /* unvisited link */ a:visited {color:#00FF00;} /* visited link */ a:hover {color:#FF00FF;} /* mouse over link */ a:active {color:#0000FF;} /* selected link */
Text Decoration
The text-decoration property is mostly used to remove underlines from links:
Identification and grouping of elements (class and id)
Grouping elements with class
Let's say that we have two lists of links of different grapes used for white wine and red wine. The HTML code could look like this:
<p>Grapes for white wine:</p>
<ul>
<li><a href="ri.htm">Riesling</a></li>
<li><a href="ch.htm">Chardonnay</a></li>
<li><a href="pb.htm">Pinot Blanc</a></li>
</ul>
<p>Grapes for red wine:</p>
<ul>
<li><a href="cs.htm">Cabernet Sauvignon</a></li>
<li><a href="me.htm">Merlot</a></li>
<li><a href="pn.htm">Pinot Noir</a></li>
</ul>
We divide the links into two categories. This is done by assigning a class to each link using the attribute class. Let us try to specify some classes in the example above:
As shown in the example you can define the properties for elements which belong to a certain class by using .classname in the style sheet of the document.