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

Welcome

Author

It is IT related blog site and Experiences of Zahid Bin A. Rouf, which has posts on technology,tips and tricks,links,troubleshoot,tutorials,computer related suggestions,reviews

Subscribe

Like Us

bangladesh-data
Bangladesh-data Blog
CodeInclude
CodeInclude Blog
tictactoe
TicTacToe Game

Bangladesh Info

CodeInclude

"There are two blessings which many people lose: (They are) Health and free time for doing good."

~Narrated by Ibn 'Abbas
~Said by Prophet Muhammad (sallallahu alayhi wasallam)
[Ref: Bukhari Hadith:Volume 8, Book 76:Softening the Heart, Number 421 ]

Pageviews last month

Flickr