This article walks you through setting the preferences for working with CSS in Dreamweaver, how to work with the CSS style panel, linking to the stylesheet, improvements to the Propert Inspector, how to creat new XHTML documents and more. (From the book ASP.NET Web Development with Macromedia Dreamweaver MX 2004, by Costas Hadjisotiriou, with Rachel Andrew and Kevin Marshall, published by Apress, 2004, ISBN: 1590593480.)
Web Standards in Dreamweaver, Part 2 - Creating Classes (Page 2 of 5 )
Creating classes in Dreamweaver is as simple as redefining an HTML tag.
Open the New CSS Style dialog box once again and select the Class (can apply to any tag) radio button. Next, in the text box at the top of the dialog box, enter a name for your class. It must begin with a period.
Click OK and the familiar dialog box will open, allowing you to set the properties for this class. Set the properties you want and click OK. Your new class will appear in the CSS Styles panel.
Attaching a Stylesheet
When you create a new stylesheet, Dreamweaver attaches it to your page automatically. However, if you already have a stylesheet that you want to attach to the page, you can attach it using the Attach Stylesheet button on the bottom of the CSS Styles panel.
The dialog box that appears allows you to browse for your stylesheet. Use the two radio buttons to select whether you want the stylesheet to be linked or imported.
Linking to the Stylesheet
Linking to the external stylesheet is the usual way of attaching a stylesheet to your page. Selecting this option will attach your stylesheet to your page with the following markup:
This way of attaching a stylesheet is not recognized by version 4 browsers, but you can use this to your advantage when you have to deal with buggy CSS support in these older browsers. We will return to this subject later.
This chapter is from ASP.NET Web Development with Macromedia Dreamweaver MX 2004, by Costas Hadjisotiriou (Apress, 2004, ISBN: 1590593480). Check it out at your favorite bookstore today.