Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


June 17, 1998

Putting Style Sheets in Perspective

CSS Rules

To work with CSS you need to understand that it is made up of rules and style sheets. A rule is the statement about the style of the document, a style sheet is one or more rules.

The first part of the rule is called the Selector. Initially, we'll use basic HTML elements that you are already familiar with as our Selectors, learning how to make our own Selectors later.

The part of the rule enclosed within the curly brackets is called the Declaration. A Declaration has two parts, the part before the colon which is the Property and the part after the colon which is the Value(s) of that Property.

A Rule
Selector{
Declarations
property: value; property: value; ...
}
H1{color: green}

(Declarations are separated by semicolons; the last declaration doesn't need one but it's good practice to put one anyway.)

In the above example:
H1 is the Selector, color: green is the Declaration.

Within the Declaration:
{ Property: Value }
color is the Property, green is the Value.

Grouping

Each rule may be placed separately within the STYLE tags, but that could make for some rather long headers. It is easier to group the rules. Note that when declarations are grouped, each declaration is separated by a semi-colon.

H1 { color: blue }
H1 { font-family: Arial }
H2 { color: blue }
H2 { font-family: Arial }
H3 { color: blue }
H3 { font-family: Arial }
H1, H2, H3 { color: blue;
	font-family: Arial;
	}

H1 Header

Additional Resources:

Putting Style Sheets in Perspective: Table of Contents
Selectors


Up to => Home / Authoring / Style / Sheets / Intro




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers