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>
.
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.
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.
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.
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'.
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; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With