Multiple Style Sheets

If some properties have been defined for the same selector in different style sheets, the value will be inherited from the more specific style sheet. For example, assume that an external style sheet has the following properties for the <h1> element:

h1 {
   color: navy;
   margin-left: 20px;
}

then, assume that an internal style sheet also has the following property for the <h1> element:

h1 {
    color: orange;
}

If the page with the internal style sheet also links to the external style sheet, the properties for the <h1> element then becomes:

color: orange;
margin-left: 20px;

The left margin is inherited from the external style sheet and the color is replaced by the internal style sheet.

Back button Table of Contents Next button