<BODY link="#000000" vlink="#000080" alink="#FF0000">
A:link { color: #000000 }
A:visited { color: #000080 }
A:active { color: #FF0000 }
A:link { color: red; text-decoration: underline }
A:visited { color: blue; text-decoration: underline }
A:active { color: green; text-decoration: none }
A:hover { color: lime; text-decoration: none }
A.link1:link { color: black; text-decoration: none }
A.link1:visited { color: blue; text-decoration: none }
A.link1:active { color: red; text-decoration: underline }
A.link1:hover { color: red; text-decoration: underline }
Листинг 2.7. Псевдостили гиперссылок
<HTML>
<HEAD>
<TITLE>Псевдостили гиперссылок</TITLE>
<STYLE>
A:link { color: red; text-decoration: underline }
A:visited { color: blue; text-decoration: underline }
A:active { color: green; text-decoration: none }
A:hover { color: lime; text-decoration: none }
A.link1:link { color: black; text-decoration: none }
A.link1:visited { color: blue; text-decoration: none }
A.link1:active { color: red; text-decoration: underline }
A.link1:hover { color: red; text-decoration: underline }
</STYLE>
</HEAD>
<BODY>
<A href="doc1.html">Ссылка1</A><BR>
<A href="doc2.html" class="link1">Ссылка2</A>
</BODY>
</HTML>
2.13. Тэги <DIV> и <SPAN>. Группируем элементы страницы
Листинг 2.8. Тэги <DIV> и <SPAN>
<HTML>
<HEAD>
<TITLE>Пример использования стилей</TITLE>
<STYLE>
.text1 { font-size: 12pt; color: red; font-family: "Arial" }
.text2 { font-size: 12pt; color: green; font-family: "Arial" }
</STYLE>
</HEAD>
<BODY>
<DIV class="text1">
<P>Абзац 1</P>
<P>Абзац 2</P>
</DIV>
<SPAN class="text2">
<P>Абзац 3</P>
<P>Абзац 4</P>
</SPAN>
</BODY>
</HTML>
<DIV align="center">Элемент с выравниванием по центру</DIV>
<DIV align="left">Элемент с выравниванием по левому краю</DIV>
<DIV align="right">Элемент с выравниванием по правому краю</DIV>