Professional Documents
Culture Documents
<p> There are four different methods used to add CSS within HTML document.
These methods differ on the basis of their placement, importance given to them by
a browser and how much of the document they effect. They are given below:</p>
<ul type=disc>
<li><b>Inline Style Sheets</b></li>
<li><b>Embedded Style Sheets</b></li>
<li><b>Linking to an External Style Sheet</b></li>
</ul>
</p>
</body>
</html>
</pre>
<h3>Output</h3>
</pre>
<h3>Output:</h3>
In order to create an external style sheet in your website follow the following steps:
<b>Step 1:</b> <p>To create an style sheet, use a plain text editor such as
Notepad, Notepad++ etc. Specify all the rules that you need to use in your
website.</p>
<pre lang=CSS>
@charset "utf-8";
/* CSS Document */
p{
color:#609;
font-size:18px;
}
h1{
color:#0F6;
font-family:Tahoma, Geneva, sans-serif;
}
</pre>
<b>Step 2:</b> After specifying the necessary rules needed, save your style sheet
with </b>.css</b> extension.
<b>Step 3:</b> Now link the external style sheet using <LINK> element in the
<HEAD> section of the webpage to which you want to apply the rule.
<pre lang=html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>External Style Sheet</title>
<link rel="stylesheet" type="text/css" href="file:///D|/CSS/css.css" />
</head>
<body>
<h1>Applying External Style Sheets</h1>
<hr />
<p> This is the tutorial of External Style Sheets in CSS.</p>
</body>
</html>
</pre>
<h3>Output :</h3>