The first half of this chapter focuses on the use of XHTML and CSS when working in Dreamweaver. Discover why developing in XHTML instead of HTML is a good idea and how to start working in valid XHTML Transitional. Some basics of CSS design are also covered. (From the book ASP.NET Web Development with Macromedia Dreamweaver MX 2004, by Costas Hadjisotiriou, Rachel Andrew and Kevin Marshall, published by Apress, 2004, ISBN: 1590593480.)
Web Standards in Dreamweaver, Part 1 - XHTML in Dreamweaver MX 2004 (Page 5 of 7 )
Whether you are new to XHTML or an experienced developer looking for a quicker way of working, Dreamweaver MX can help you write valid XHTML quickly and accurately.
Setting your preferences will ensure that Dreamweaver MX is working with you to create valid XHTML or HTML documents right from the outset. To access the Preferences dialog box, select Edit -> Preferences.
The General Pane
In the General pane of the Preferences dialog box, make sure that the Use <strong> and <em> instead of <b> and <i> option is checked.
The <b> and <i> tags will not cause your page to be invalid, but from a best practices point of view, it is suggested that you use <strong> and <em> instead. Why? Because <b> for bold text and <i> for italic text are presentational tags designed to tell the browser how something should look. The <strong> and <em> tags are logical tags that tell the browser or device that the document author wants a word or statement to have particular emphasis.A screen reader, for example, may interpret these tags with an inflection designed to give the person listening to the page the same understanding as someone seeing bold or italic text.
Your page should look exactly the same in a conventional browser whichever choice you make, so this is one place where making a small change can really lift the accessibility of your web site without altering the look of the pages.
While in this pane, make sure that the Allow multiple consecutive spaces check box is well and truly unchecked! If this is checked, pressing the spacebar will insert multiple into your code, which is really annoying. From a best practices viewpoint, indentation of page elements should be created with CSS, not by adding nonbreaking spaces.
The Accessibility Pane
In the Show Attributes when inserting area of the Accessibility pane, ensure that the Images check box is selected. For your documents to validate against accessibility requirements, they must have alt text. This check box will remind you to add that text each time you insert an image. If you want to create valid and accessible code, you may want to check the Form Objects, Frames, Media, and Tables check boxes as well.
The New Document Pane
If you want to use XHTML for future work, you can set Dreamweaver MX to make new documents XHTML-compliant automatically. To do so, check the Make document XHTML compliant check box in this pane. Alternatively, you can choose to make documents XHTML-compliant each time you create a new document in Dreamweaver MX, although the original default will be HTML.
The Validator Pane
In this pane, you can specify which DTD you want to validate against with the internal validator. Check the DTD that you will most often use—you can always go back and change it if you are working on a site that requires a different DTD.
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.