Learning HTML by yourself


6 - Starting CSS coding for one page.

23/11/2011 18:41

If you want to set up a stylesheet to affect one Web page, you can do that with a stylesheet in the head of your document. For this you use the tag in the

of your Web document.

Rules for Style Sheets

  1. Style tags should be held in the
  2. All style information should be stored within the tags.
    This is how the browsers know that the information is for styles.
     
  3. Always include a type attribute in your style tag.
    This attribute indicates what types of style rules you will be using. The most common type of style rule is CSS, but there are other types (XSL, JSS, and others).

Tips for Working with Style Sheets

Here are some tips for working with these stylesheets:

  • Start them out right
    Use attributes of the style tag to define what the browser should expect

  • Use comments.  Comment tags insure that older browsers don't display your stylesheets.

  • Think about your styles.  In many cases, you don't need to set a lot of different stles, just simple ones that cover how your text and other elements should be dkisplayed on your page.  If you don't plan to have any red, blinking, 36 point headlines on your page, then defining a style for that is a waste of bandwidth.

 

 

—————

Back