Page 89 - Plus_V2.2_C7_Flipbook
P. 89
Let us create a CSS file and add the code given below. Save the file with the name MYSTYLE.css.
body
{
background-color: lightblue;
}
h1
{
color: Red;
}
h2
{
color: Green;
}
Now, create a HTML document with the reference of the CSS file.
<!DOCTYPE html>
<HTML>
<HEAD>
<LINK REL="STYLESHEET" TYPE="TEXT/CSS" HREF="MYSTYLE.css">
<TITLE>External Style Sheet</TITLE>
</HEAD>
<BODY>
<H1>Cascading Style Sheet</H1>
<H2>Linking External Style Sheet</H2>
</BODY>
</HTML>
Using external Style Sheet
Internal Style Sheet
Internal style sheet is directly placed within the HTML document, typically inside the <STYLE> tag within
the <HEAD> section. The styles are only applied to the HTML document in which they are defined. This
method is suitable for small projects or when a specific page needs unique styles.
Let us create a web page using the internal style sheet.
Using CSS in HTML5 87

