External Stylesheets

The third and best way of using stylesheets is to place them into a separate file and link them into all of your web pages.

If we use this method then the same styles that we define can be automatically applied to every tag of the same type within every page of our entire site. Later tutorials will show you how to set up entries that have more limited effect.

To get our stylesheet working this way all we need to do is to put the stylesheet commands in a separate css file instead of between style tags on each page. We then link to that css file (for example master.css) using the following code:

<link rel="stylesheet" href="master.css" type="text/css" />

By placing this tag into the head section of every page of our site (immediately before the </head> tag is a good spot) we can apply the same styles to every page of our site taking us a good part of the way toward giving all of the pages of our site a common look and feel and making it look like all of the pages belong to the same site.


This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow