0% found this document useful (0 votes)
29 views1 page

Color: h1 Font Font h1

The document discusses using CSS instead of HTML presentational attributes to style elements. It provides an example of using an internal style element or external CSS file to style all h1 elements red without needing code for each. Styles can then easily be changed by modifying the single style element or CSS file.

Uploaded by

mansi bavliya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views1 page

Color: h1 Font Font h1

The document discusses using CSS instead of HTML presentational attributes to style elements. It provides an example of using an internal style element or external CSS file to style all h1 elements red without needing code for each. Styles can then easily be changed by modifying the single style element or CSS file.

Uploaded by

mansi bavliya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

<h1><font color="red">Chapter 1.

</font></h1>

Using CSS, the same element can be coded using style properties instead of HTML
presentational attributes:

<h1 style="color: red;">Chapter 1.</h1>

The advantages of this may not be immediately clear but the power of CSS becomes more
apparent when the style properties are placed in an internal style element or, even better, an
external CSS file. For example, suppose the document contains the style element:

<style>
h1 {
color: red;
}
</style>

All  h1  elements in the document will then automatically become red without requiring any
explicit code. If the author later wanted to make  h1  elements blue instead, this could be done by
changing the style element to:

<style>
h1 {
color: blue;
}
</style>

rather than by laboriously going through the document and changing the color for each
individual  h1  element.
The styles can also be placed in an external CSS file, as described below, and loaded using
syntax similar to:

You might also like