Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When will an <a> tag not inherit color attribute of parent tag?

Here is my code:

.blue {      color:#6E99E1;      font-size:9px;  }
<span class="blue">::<a href="/equipment_new.php">CLICK HERE</a>:: to view our New Equipment inventory. <br /><br /></span>

I've somehow triggered something that prevented the <a> tag from inheriting color of parent <span>.

like image 998
omg Avatar asked Jul 17 '09 18:07

omg


People also ask

How do you inherit parents CSS?

The inherit CSS keyword causes the element to take the computed value of the property from its parent element. It can be applied to any CSS property, including the CSS shorthand property all . For inherited properties, this reinforces the default behavior, and is only needed to override another rule.

What does color inherit mean?

Inheritance happens there too. If you set a property in a parent element, the children by default inherit the properties and their values without explicitly defining the property. A property such as color is passed down to an element's children. If an element is green, all its children turn green.

Which tag has inherent styles associated with it?

Styles in parentheses are inherent styles applied by the browser for the particular HTML tag. In some cases, a style property is not inherited from its parent—obvious properties such as margins, width, and borders.

What is background inherit?

Background properties do not inherit, but the parent element's background will shine through by default because of the initial 'transparent' value on 'background-color'.


1 Answers

Just an addendum to the other responses, if you want your <a> tags to inherit the colour from their parent you can use

a {color: inherit; } 
like image 179
David Thomas Avatar answered Sep 19 '22 16:09

David Thomas