How to change HTML hyperlink font color? Summary of methods for changing the color of a hyperlink font

Source: Internet
Author: User
This article mainly tells about the HTML hyperlink text font Color change method, said one is a pure a-label text changes, there is a tag is placed in the DIV tag for CSS style changes. Now let's take a look at the contents of the article.

First, let's start with an example to change the font color of the hyperlink:

All we have to do is not click the hyperlink text is not underlined, gray, when the mouse on the link is underlined, the link text is displayed in red, when the link is clicked, the link is not underlined and appears yellow.

Let's look at the complete experiment Code:


There are three of them:

This is an image that is not clicked, without an underscore and grayed out.

This is the mouse up the style, there is an underscore, shown in red.

This is the style that is clicked, no underline, and is displayed in yellow text.

These are the experimental results of the above code. It's just that the task is done, and it makes it easier to understand the code above.

Now let's take a look at the specific meanings of the above code:

    • A:link refers to a normal link that has not been visited;

    • A:active refers to the link being point;

    • A:hover refers to the mouse on the link;

    • A:visited means a link that has been visited;

    • Text-decoration is the meaning of the text modification effect;

    • The None parameter indicates that the hyperlink text does not appear underlined;

    • The underline parameter indicates that the text of the hyperlink is underlined

Now it is understood that this is not a better understanding of the above code, is to take these one by one into the inside.

Now there is an example of a hyperlink in the div tag , we want to change the text of the hyperlink within the div tag to color, how to change it?

Let's look at the explanation code together:

1.CSS Code:

a{color: #00F}a:hover{color: #F00}/* mouse over hover font color *//* CSS Comment Description: The above code is set HTML hyperlink unified font Color */.div a{color: #090}.div a:hover{Co Lor: #090}/* CSS Comment Description: The above code is set in HTML. A hyperlink font color inside a div object

2.html Code:

<p> Test content I am a unified set of colors Blue <a href= "http://www.php.cn" >php Chinese web </a></p><div class= "div" > I am within the Div object, the hyperlink color is <a href= "#" > I am Hyperlink green </a></div>

The effect of this code is as follows:

The text above is programmed in blue, and the text below becomes green. The effect is obvious.

This is the way to change the hyperlink text in HTML using CSS styles. If you have questions, you can ask them below.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.