Style Sheets
  Home arrow Style Sheets arrow Page 2 - What is CSS?
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
STYLE SHEETS

What is CSS?
By: Marc Knuttel
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 13
    2004-05-17

    Table of Contents:
  • What is CSS?
  • CSS Syntax
  • Placement of CSS Elements
  • Cascading - What Does it Mean?
  • Your First Style Sheet

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    What is CSS? - CSS Syntax


    (Page 2 of 5 )

    Style rules are comprised of two things, the selector and the declaration.

    • selector - The HTML tag that will be affected by the rule

    • declaration - The specific style calls that will affect the selector

    The complete syntax for a style rule is:

    selector {property : value;}

    So, to set all bold text to be the color red, you would write:

    b {color: red;}

    One of the things that makes CSS so easy to use, is that you can group together components that you would like to have the same style. For example, if you wanted all the H1, H2 and bold text red, you could write:

    b {color: red;}
    h1 {color: red;}
    h2 {color: red;}

    But with grouping, you put them all on the same line:

    b, h1, h2 {color: red;}

    You can also group together rules (separated by a semi-colon (;) ). For example, to make all h3 text blue and Arial font, you would write:

    h3 {
    font-family: Arial;
    color: blue;
    }

    By convention, we put separate rules on separate lines, but this is not required.

    More Style Sheets Articles
    More By Marc Knuttel


     

    STYLE SHEETS ARTICLES

    - Improving the Visual Presentation of a CSS D...
    - Fixing Browser Incompatibilities in a CSS Dr...
    - Building Clean Drop-Down Menus with CSS
    - Creating Hybrid Web Page Layouts with Negati...
    - Creating Three-Column Web Page Layous with N...
    - Swapping Column Positions in Web Page Layout...
    - Creating Web Page Layouts with Negative Marg...
    - Creating Gradients for Individual Containers...
    - Creating Gradients for Web Page Headers with...
    - SEO Scrolling Frames Problem Solved
    - Building Cross-Browser Background Effects wi...
    - CSS: Pseudo
    - Using PNG Images to Build Background Effects
    - CSS: Continuing the Clarification of CSS Cla...
    - CSS: Top Secret Classification






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
    Stay green...Green IT