*.CSS files

Insted of having the css code in every document you can have it in *.css files. A common css code could look like this:

<style type="text/css">
<!--
a {
      font-family: Verdana, Arial, Helvetica, sans-serif;
      font-size: 9pt;
      color: #45506B;
      text-decoration: none;
}
#container {
      margin: 0 auto;
      width: 500px;
}
.redtext {
      color: #CC0033;
}
-->
</style>

In a *.CSS file it would look like this:

a {
      font-family: Verdana, Arial, Helvetica, sans-serif;
      font-size: 9pt;
      color: #45506B;
      text-decoration: none;
}
#container {
      margin: 0 auto;
      width: 500px;
}
.redtext {
      color: #CC0033;
}

Not a big difference just the

<style type="text/css">
<!-- 

and

-->
</style>

are removed so this isn't the good part with css files.

The good thing with css files is that you only need one *.CSS file and then you import it to your document(s). So when you want to change something just do it in the css file and it will take effect on all pages with the file imported. So to create a CSS file, just create a simple text document and open it and write what you want in it. Then save the file with extension as .css. To edit it use your favourite text editor.

Just insert

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

or

<style type="text/css">
<!--
@import url("***.css");
-->
</style>

between <HEAD> and </HEAD>

Comments

Written by vivek | Sun, 30 Mar 2008, 11:06

i want learn css pls give me pdf of css tutorial

Leave a comment

CAPTCHA image (Click the image to get a new one)