Links without underlining
By means of HTML tags to remove the underscore from the reference is not possible. Therefore, cascading style sheets (Cascading Style Sheets, CSS) are used for this purpose.
One of the most popular uses for CSS references - taking away from them the underscore. From the standpoint of usability is not quite the right decision, because the user can not immediately guess that the text, which he sees is a link. All in fact already used to - again underlining is used, then it is a link. But when used correctly in the absence of an underscore links can give a certain effect site. is often done, that when you move the cursor, the link becomes accentuated, changes color, or use both effects at the same time.
The emphasis is hidden by a stylistic parametroa text-decoration: none, adding it to the selector A, as shown in Example 1.
Example 1. retracting underscores in references
<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "text / html; charset = windows-1251">
<Title> The emphasis in the links </ title>
<Style type = "text / css">
A {
text-decoration: none; / * Removes references to underline * /
}
A: hover {
text-decoration: underline; / * Add the underscore when you hover over the link * /
color: red; / * Link red * /
}
</ Style>
</ Head>
<Body>
<P> <a href="link.html"> Move your cursor here, you will see the result </a> </ p>
</ Body>
</ Html>
Below is the result of this example. When you hover over a link, it becomes red and underlined.
© Policy Copyright www.htmlbook.ru
Comments
Commenting, keep in mind that the content and the tone of your messages can hurt the feelings of real people, show respect and tolerance to his interlocutors, even if you do not share their opinion, your behavior in terms of freedom of speech and anonymity offered by the Internet, is changing not only virtual, but real world. All comments are hidden from the index, spam control.