Sunday, May 16, 2010

How to Include External CSS file in a webpage


To include a CSS file externally in a webpage , use the link tag.

<link rel="stylesheet" type="text/css" href="style.css" />
Write this tag just after the head tag inside html tag.

Sample code :


<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<h3> Welcome </h3>
<p> This is my site . Here CSS file has been included externally. </p>
</body>
</html>

Sample style.css file :
body{ background-color: green;}
h3{ color: blue; }

Done.

No comments:

Post a Comment

Train Schedule Info

Subscribe

Quote

"There are two blessings which many people lose: (They are) Health and free time for doing good."
[Ref: Sahih al-Bukhari - Hadith number:6412]