Getting Started with CSS Style SheetsReady for a night out on the town with CSS? Are you looking sharp? You didn't have your parents drop you off, did you? Okay, off we go!A style is just a set of formatting rules for your text to follow. A style sheet is a file that holds a group of styles. These files are called Cascading Style Sheets because of the way the styles flow, or cascade, through your page, or even your entire site.In Chapter 5, you saw how Dreamweaver uses Cascading Style Sheets to build a library of styles for you in the Property Inspector as you work. By default, Dreamweaver creates styles that apply to a single page at a time: an embedded style sheet. An embedded style sheet is stored within your current page. But to really get the most out of style sheets, you should create one that applies to all of the pages in your web site: an external style sheet. External CSS to control an entire site later in this chapter. But first, let's look at what's involved in editing styles that you've already created. Put on a dinner jacket and pop a mint so I can introduce you two lovebirds. Getting Started with Dreamweaver's Sample Style SheetsHere's a great way to get started with CSS: Use Dreamweaver's sample style sheets. Dreamweaver comes loaded with many style sheets that you can browse through and apply to your pages. Once you apply a style sheet to your page, you can use the CSS Styles panel to edit and change the styles as much as you like.With your page open in Dreamweaver, follow these steps to give the sample style sheets a try:
external style sheets later in the chapter. |
Editing Your Styles
Chapter 5, you created a few basic styles, renamed them, and applied them to your page. Now what if you want to make changes to your styles? If you try making changes using the Property Inspector, Dreamweaver creates a new style for you rather than editing the existing stylewhich isn't what you want.Style editing takes place in the CSS Styles panel.
The CSS Styles Panel![]() |
![]() | To expand the size of either the top or bottom pane in the CSS Styles panel, bring your mouse over the area that divides the two panes (your cursor should change to a double-headed arrow) and drag. |
The Property Pane's Three ViewsThe three buttons at the bottom left of the CSS Styles panelShow Category View, Show List View, and Show Only Set Propertiesallow you to control the Properties pane display.You can use the CSS Styles panel to create and edit styles whether you're in Design view or Code view.Use the three view buttons at the bottom of the CSS Styles panel to control what the Properties pane displays. Category view organizes all the available CSS properties into categories that can be expanded and collapsed and has a structure similar to that of the CSS Rule Definition dialog box, which you'll see later in this chapter. List view presents an alphabetized list of all properties, with any currently set properties displayed at the top of the list. Show Only Set Properties displays only the properties that have been set for the selected style.You may be confused at first about which view to use, especially if you're all nervous and stuff on your CSS date. But remember that these buttons control only the display of the Properties panethey don't change your styles. |
| 1. | Click the All button at the top of the CSS Styles panel to set the panel's mode.If you're working on a page where you've already applied some styles, the panel lists all the styles that you created. |
| 2. | In the All Rules pane in the top, select the style that you want to edit.![]() |
| 3. | In the bottom-left corner of the CSS Styles panel, click the Show Category View button. |
| 4. | In the Properties pane, expand a category by clicking the plus sign (Windows) or the expander arrow (Mac). For instance, expand the Font category to change the font. If you've already set font, size, and color formatting for your style via the Property Inspector, then you'll see those settings in the Font-Family, Font-Size, and Color fields. Currently set properties always appear in blue; properties that are not set appear in black. |
| 5. | In the right hand column, select the attribute that you want to change and then choose a new setting. |
Rule Definition dialog box later in this chapter.
If you want to remove a value, just select it and press the Delete key.Any changes that you make are applied instantly, meaning that any text on your page that's currently using the style is automatically updated. How's that for speed? Start planning the weekend!
Ten Ton DreamweaverBy
Geoff Blake...............................................Publisher: Peachpit PressPub Date: February 08, 2006Print ISBN-10: 0-321-37412-6Print ISBN-13: 978-0-321-37412-7Pages: 456Index
When you click a style, a preview and description appear at the right. To see how the style sheet will look when applied to your page, click the Preview button.


Category view organizes all the available CSS properties into categories that can be expanded and collapsed and has a structure similar to that of the CSS Rule Definition dialog box, which you'll see later in this chapter. List view presents an alphabetized list of all properties, with any currently set properties displayed at the top of the list. Show Only Set Properties displays only the properties that have been set for the selected style.You may be confused at first about which view to use, especially if you're all nervous and stuff on your CSS date. But remember that these buttons control only the display of the Properties panethey don't change your styles.
If you've already set font, size, and color formatting for your style via the Property Inspector, then you'll see those settings in the Font-Family, Font-Size, and Color fields. Currently set properties always appear in blue; properties that are not set appear in black.