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:
<link href="global.css" rel="stylesheet" type="text/css" />
This way of attaching a stylesheet is supported by all CSS-enabled browsers, and it is what you should do if you need to support browsers such as Netscape 4 with your web page.
Importing the Stylesheet If you choose to import, the stylesheet will be attached with the following markup:
<style type="text/css">
<!--
@import url("global.css");
-->
</style>
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.
Buy this book now. |
Next: The Property Inspector >>
More Web Standards Articles
More By Apress Publishing