Cascading Style Sheet Quick Guide

 
 
This guide contains information how to create Cascading Style Sheets (CSS).

More information about CSS can be found at: http://www.w3.org/Style/CSS/

rss feed






Using a stylesheet file.




Procedure
  1. Create a file with an extension .css, for example: ../syles/basic.css

  2. Add the stylesheet code in this file. See CSS Syntax.

  3. There are two methods to add a css file to your page:

    • Using linked stylesheets

      Add inside the <head></head> tags, the following:

      Example
      <link rel="stylesheet" type="text/css" href="../styles/basic.css" />
      <link rel="stylesheet" type="text/css" href="../styles/product.css" />

    • Using imported stylesheets

      Add inside the <head></head> tags, the following:

      Example
      <style type="text/css" media="all">
      @import "../styles/basic.css";
      @import "../styles/product.css";
      </style>

      Note 1: The imported stylesheet method is supported by browsers of versions 5 and above.
      Note 2: The imported stylesheet method is not recommended.