Google Custom Search

What is a css file

To put it in simple terms, a css file is a list of directives used to control the design and layout (also known as presentation) of a web page. The css file is linked to the web page instead of the style code being actually placed in the page itself. This makes it possible to control the style of an entire web page from a single file.

Before the cascading style sheet was developed, if a webmaster wanted to make changes, he /she had to go to each individual page of a web site to make the changes. Even with a small web site you can see how time consuming and hair pulling intensive this would be. But now, with the advent of css, all the webmaster needs to do is change the css file.

Separate style and content

CSS is used to separate your content (HTML) from your design (style). Placing your css in a separate file makes it easier to design your page or write your content. To design your page you work from the css file. When writing content you deal only with html. The two being separate makes the page less cluttered and therefore less confusing.

Linking the css file to your web page

The css file is stored in the root directory of your web site and linked to each page with a <link href> attribute that is placed in the <head> section of your page. This is also known as an external css file. The link for an external css file looks like this
<link href="/location/name.css" rel="stylesheet" type="text/css" />

go to the next terrific page Using CSS to layout your page