Modify the hyperlink color

Change the color of hyperlinks within the web page can usually make hyperlinks more in line with the overall style of web design, common in the early pages hyperlinks , will use the default blue, read the hyperlinks are displayed in purple, with With the improvement of web design standards, it is almost impossible to satisfy high-level design styles with such preset colors alone. This article will provide two different ways to modify the color of web hyperlinks, both of which are CSS techniques. The method most designers will use, most mainstream browsers support the following examples.

Method of modifying the color of hyperlinks 1. Modify directly in the <a> tag

<a href="#" style="color:red;">Edit the hyperlink color to red</a>

The above writing will output

It is a simpler way to modify the color in the <a> tag, and it is also the one with the highest execution order. The "style="color:red"" in the syntax specifies that the color of this hyperlink is red, starting from "  You can also find more colors in " Code Table ". When the designer uniformly designs the hyperlink color of the entire web page to a certain color, but several of the hyperlinks must use different colors, this technique can be used. The browser Will give priority to the color in the <a> tag.

Method two to modify the color of hyperlinks, write CSS to modify the whole page

<style>
a {
    color:green;
}
</style>
<a href="#">Change the hyperlink color to green</a>

The above writing will output

The second method is to write CSS syntax in the <style> tag to manage the color of hyperlinks on the webpage. The beginning of a in the syntax means to design the style of a href ", which is the style of hyperlinks in the webpage. "Color:green" means that in addition to the hyperlinks with additional design colors , all other hyperlinks are green. You can also find other colors in the " Color Code Table " to replace them. This writing method is suitable for managing the entire web page at one time All hyperlinks are the method used by many large commercial websites.

Post a Comment

0 Comments