Why a link cannot inherit color

Source: Internet
Author: User

The following are personal insights, if there are errors, please Daniel to help correct.

---------------------------------------

<!DOCTYPE HTML><HTML><Head>    <MetaCharSet= "Utf-8">    <title></title>    <styletype= "Text/css">Div{Color:Yellow;        }    </style></Head><Body>    <Div>        <span>Text</span>        <ahref="#">Link</a>    </Div></Body></HTML>

The reason is because the code above, very simple, but the problem arises, the link can not inherit the parent div color attribute, the span tag can be, the solution is very simple, div a {color:yellow;} Can be done, Curiosity came up, who also can't stop, the whole bar.

Everywhere ask Ah, first google down, I go, this should be how to say, let the hyperlink inherit color? Can not find Ah, depressed a bit, find QQ group to help it, a ask scare jump, everyone knows, then you do not share it! Hugan, everyone's meaning is back down, want to understand their own browser code how to render, I want to say I just learned one months, but still endure the pain of saying thank you, ctrl+w.

Turn a circle or some harvest, there is a person in the group said a link can not inherit the color, I take a go, an epiphany now ah there are wood, open Google copy and paste, there are related links, well, this time has a feeling: ask questions to ask the quasi ah.

Look, sure enough there is a csdn problem, look! Open it.. Amount: Failed.. But the mood ah, still let people sleep, Baidu a bit, the same keyword, the amount ... You know what I'm going to say next.

Yesterday just study HOSTSFQ, so there are a lot of problems, recently Firefox also committed convulsions, with the next chrome, looked, link here in line of sight fixed in 2L.

"Color defines plain text (not including hyperlink a)" And it's a glittering word, a click, a snippet of code.

<!DOCTYPE HTML><HTML><Head>    <MetaCharSet= "Utf-8">    <title></title>    <styletype= "Text/css">Div{Color:Yellow;        }    </style></Head><Body>    <Div>        <P>Paragraph</P>        <span>Text</span>        <H1>Title</H1>        <ahref="#">Link</a>        <Button>Button</Button>    </Div></Body></HTML>

Well, a bit of a reason, link buttons are not text Ah, in my coming to the conclusion of the time, read the next know, really know! Question link answer @ Ma Yi's truth-like answer appears! Actually just in QQ group also some people say, but was I a style resets the table to ignore, or is extremely sorry.

Randomly find an article about CSS priorities

It is true that the inherited CSS style is not as good as the CSS style later specified;

The conclusion arises: because the browser default style is directly assigned to a specific tag, the inherited CSS style is not as good as the later CSS style, so the above situation occurs.

Reflection:

1. You should think carefully about everyone's ideas.

2. Pay attention to the way you ask questions.

3. Let's start with Google.

Why a link cannot inherit color

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.