• CSS Getting Started

    You should have basic knowledge in html before continuing in this tutorial. You will need a text editor to be able to create stylesheets. You can use any of the following:

    • NotePad++
    • DreamWeaver
    • Aptana Studio
    • NetBeans
    • Eclipse

    CSS or Custom Style Sheets designs your webpage and give life to your layout design. CSS file have a .css file extension. A CSS can be added inside the header tag of the html file, it can also be link the .css file or add the css file inline of the element.

    CSS inside head

    <html>
       <head>
          <style type="text/css">   
             p {
                color: blue;
             }  
          </style>
       </head>
       <body>
          <p>This is a paragraph colored blue.</p>
       </body>
    </html>

    CSS from External File

    <html>
       <head>
          <link href="style.css" type="text/css" rel="stylesheet" />
       </head>
       <body>
          <p>This is a paragraph colored blue.</p>
       </body>
    </html>

    and in your style.css file contains:

    p {
       color: blue;
    }

    CSS Inline Style

    <html>
       <head></head>
       <body>
          <p style="color:blue">This is a paragraph colored blue.</p>
       </body>
    </html>

    All of this will give the same output:

    Output

    This is a paragraph colored blue.

    Related Post