Home >> Tutorials/FAQs >> CSS Tutorials >> Index
CSS Tutorials - Style Property Inheritance
By: FYICenter.com
(Continued from previous topic...)
What Is Style Property Inheritance?
Style property Inheritance is a rule that allows a style property of a child HTML tag to inherit
the same property of the parent HTML tag, if that property is not defined on the child tag.
This inheritance rule is very important because a lots of style properties are defined
on the parent tags and inherited to the child tags. The CSS below shows you how to define
most of the font properties on <P> tags and let <STRONG> and <EM> to inherit them:
<html><head>
<title>CSS Included</title>
<style type="text/css">
BODY {background-color: black}
P {font-family: arial; font-size: 12pt; color: yellow}
STRONG {font-weight: bold}
EM {font-style: italic}
</style>
</head><body>
<p>Welcome to <strong>FYICenter.com</strong>.
You should see this text in <em>yellow</em>
on black background.</p>
</body></html>
As you can, the font family, size and color in <STRONG> and <EM> are inherited from <P>.
(Continued on next topic...)
- What Is CSS (Cascading Style Sheets)?
- What Is the Basic Unit of CSS?
- How Many Ways to Attach CSS to HTML Documents?
- How To Include CSS Inside an HTML Tag?
- How To Include CSS Inside the HEAD Tag?
- How To Store CSS Definitions in External Files?
- How Many Ways to Select HTML Tag Instances?
- What Is a Class Selector?
- What Is an ID Selector?
- What Is a Contextual Selector?
- What Is a Group Selector?
- What Is a Mixed Selector?
- What Are the Pseudo Classes on <A> Tags?
- How To Group CSS Definitions Together?
- What Is Style Property Inheritance?
- What Is CSS Cascading?
- What Are the CSS Cascading Order Rules?
- How To Remove the Top White Space of Your Web Page?
- How To Set Different Text Fonts Inside Tables?
- How To Use Class Selectors to Differentiate Tag Instances?
- How To Use IDs to Override Classes?
|