CSS Tutorial - Table of contents

How does CSS work?

Method 1: In-line (the attribute style)

One way to apply CSS to HTML is by using the HTML attribute style. Building on the above example with the red background color, it can be applied like this:

    <html>
      <head>
        <title>css zilla</title>
      </head>
      <body style="background-color: #FF0000;">
        <p>CSS Zilla the ultimate css blog</p>
      </body>
    </html>
   

Method 2: Internal (the tag style)

Another way is to include the CSS codes using the HTML tag <style>. For example like this:

    <html>
      <head>
        <title>css zilla</title>
        <style type="text/css">
          body {background-color: #FF0000;}
        </style>
      </head>
      <body>
        <p>CSS Zilla the ultimate css blog</p>
      </body>
    </html>
   

Method 3: External (link to a style sheet)

An external style sheet is simply a text file with the extension .css. Like any other file, you can place the style sheet on your web server or hard disk.

For example, let's say that your style sheet is named style.css and is located in a folder named style.

-www.csszilla.blogspot.in{root parent}
---index.html
-style{sub folder}
---style.css


 

Comments

Popular posts from this blog