HTML and CSS Reference
In-Depth Information
CSS. However, if you're using an HTML editor to build your web pages, you'll almost certainly find that it provides
you with code hints or other features, such as code coloring, to help create your style rules. Adobe Dreamweaver
( www.adobe.com/products/dreamweaver ) and Microsoft Expression Web ( www.microsoft.com/expression/
products/overview.aspx?key=web ), both offer pop-up code hints similar to those shown in Figure 1-3 .
Figure 1-3. Using CSS code hints in Dreamweaver
There are also dedicated CSS editors. Among the most popular are Style Master for Windows and Mac
( www.westciv.com/style master/ ) , Espresso for Mac ( http://macrabbit.com/espresso/ ), and Top Style for
Windows only ( http://svanas.dynip.com/topstyle/index.html ) .
Note
Your choice of editor is unimportant. This topic is strictly software and operating system neutral.
How Do I Write a Style Rule?
Creating a style rule is simple. Figure 1-4 shows the different parts that make up a style rule.
Let's take a look at each part in turn:
Selector: This tells the browser where you want to apply the rule. Figure 1-4 uses a type
selector (sometimes called a tag selector ), which redefines the default style of an HTML
tag. This example redefines the style of all <p> tags—in other words, paragraphs. You'll
learn about other selectors in the next chapter.
Selector
Declaration block
p{
margin-left : 40px ;
}
Property
Value
Figure 1-4. The anatomy of a style rule
 
 
Search WWH ::




Custom Search