How To Change The Color Of Links On The Site

Table of contents:

How To Change The Color Of Links On The Site
How To Change The Color Of Links On The Site

Video: How To Change The Color Of Links On The Site

Video: How To Change The Color Of Links On The Site
Video: HTML Tutorial 8 - Changing Hyperlink Color 2024, November
Anonim

In the process of working on the site, both professional webmasters and people who are engaged in updating the site, but are not professionals, make various changes to the style of the web resource. For example, you may need to change the color of links on the site for some reason.

How to change the color of links on the site
How to change the color of links on the site

In this case, you need to know that the color of the links is changed using CSS (Cascading Style Sheets) - cascading style sheets. These are tables used in conjunction with a programming language to create a web resource. CSS is responsible for the structure of the site, that is, for its style, appearance, and html - for the content of the resource. CSS is a continuation of the evolution of HTML.

Link color on the site

So, you can change the color of links both for the site as a whole, and for each link separately. Link colors are set as an attribute of the main tag. An attribute is something that you do not need to write in the code, since some of them are already set by default. The link attribute determines the color of the links on the site page. The default is blue. Alink is an attribute that determines the color of active links, by default it is red. Vlink - visited links, their generally accepted color is purple.

Most often, the color of links on web pages is specified in hexadecimal notation (#EEEEEE - gray) or in rgb format (# 808080 - gray), however, you can also use traditional English color notation (gray - gray). In addition, the color can be set in degrees, the HSL format is suitable for this. Color charts are easy to find on the Internet.

Change the color of links

To change the color of all links on the page, it is enough to change the color of the color attribute in the styles. To do this, find the style.css file, open it and find the a attribute. For example, A {color: green; / * Link color * /}, where A is a link, the color of which we change to green. You can change the color value as you like using any of the color notation systems. The browser will "understand" you. The style will apply to all links on the web page. You can change the colors of other attributes in the same way, for example, the color of a link when you hover over it with the mouse cursor.

To make links in different colors on a web page, use the following entry in the stylesheet:

.menu a {color: gray; }

.content a {color: green; }

It follows from the example that the links for the menu will be gray, and the links in the content block will be green.

The same steps can be done with links if the styles are not in a separate file, but in the html document itself. These are contextual selectors.

If you want to quickly edit styles and change the colors of links, then it is better to use the visual editor Dreamwever. The main thing to remember is that links should look organic in relation to the entire web page. For light backgrounds, dark links are better and vice versa.

Recommended: