How To Change Link Color In Html

Table of contents:

How To Change Link Color In Html
How To Change Link Color In Html

Video: How To Change Link Color In Html

Video: How To Change Link Color In Html
Video: HTML Tutorial 8 - Changing Hyperlink Color 2024, December
Anonim

Novice web developers often wonder about changing the appearance of hyperlinks. This is quite natural, because the topic of the correct formatting of links is constantly raised by designers and layout designers.

How to change link color in html
How to change link color in html

Instructions

Step 1

By default, links are drawn in blue (# 0000FF), have an underline and change color when they switch to purple (# 800080), with active links highlighted in red (# FF0000). Color setting for all links on the page in their different states is carried out using standard HTML tools - three attributes of the tag. Changing the design parameters of individual links can be done by changing the values of the attributes of the corresponding tag.

Step 2

There are three ways to set values for style attributes. In all cases, you must specify the font and underline color, which can be in the form of a hexadecimal code in full (#FFFFFF) or abbreviated (#fff) variants. The color can also be specified in the RGB format (101, 010, 111) or the standard html value of the style attribute, that is, the keyword (gray, red, etc.). These values are set for the link, alink, and vlink attributes.

Step 3

The optional link attribute of the tag determines the color of all hyperlinks on the page. If the attribute is not specified, the default is assumed.

Step 4

The optional alink attribute of the tag determines the color of all active hyperlinks, that is, changes the color of the link to the one specified when clicking on it. Menu items that point to the page currently open in the browser are also considered active hyperlinks. If the attribute is not specified, the default is assumed.

Step 5

The optional vlink attribute of the tag determines the color of all visited hyperlinks, that is, changes the color of the link after clicking on it. If the attribute is not specified, the default is assumed.

Step 6

You can use CSS properties in the HTML document to change the color of all hyperlinks. They are written between the paired tags and specified between the required tags and. Properties are set through the A: selector, with the visited pseudo-class, which specifies the color of visited links, active, which specifies the color of active links, or hover, which specifies the color of links when hovering over them.

Step 7

If it becomes necessary to change the color of an individual link, and not all at once, you should use the style attribute for the tag, thus connecting the styles to a specific tag. The value of the attribute in this case is the color property, the writing syntax is as follows:, that is, you can use any of the four methods for specifying a color.

Recommended: