Adobe Dreamweaver
Advanced Tips, Tricks, Hacks, and Tweaks...
 |
| |
| Cleaning up your Code |
Dreamweaver can automatically remove empty tags, combine nested font tags, and otherwise improve messy or unreadable HTML or XHTML code. For information on how to clean up HTML generated from a Microsoft Word document. To cleanup code:
- Open a document
- If the document is in HTML, select Commands > Clean Up HTML
- If the document is in XHTML, select Commands > Clean Up XHTML
- For an XHTML document, the Clean Up XHTML command fixes XHTML syntax errors, sets the case of tag attributes to lowercase, and adds or reports the missing required attributes for a tag in addition to performing the HTML cleanup operations
- In the dialog box that appears, select any of the options
- Click OK
- Depending on the size of your document and the number of options selected, it may take several seconds to complete the cleanup
|
| |
| Verifying that Tags and Braces are Balanced |
You can check to make sure the tags, parentheses (( )), braces ({ }), and square brackets ([ ]) in your page are balanced. Balanced means that every opening tag, parenthesis, brace, or bracket has a corresponding closing one, and vice versa. To check for balanced tags:
- Open the document in Code view
- Place the insertion point in the nested code you want to check
- Select Edit > Select Parent Tag
- The enclosing matching tags (and their contents) are selected in your code. If you keep selecting Edit > Select Parent Tag, and your tags are balanced, eventually Dreamweaver will select the outermost html and /html tags
|
| |
| Validating your Tags |
You can use Dreamweaver to find out if your code has tag or syntax errors. Dreamweaver can validate documents in many languages, including HTML, XHTML, ColdFusion Markup Language (CFML), JavaServer Pages (JSP), Wireless Markup Language (WML), and XML. To validate your tags do one of the following:
- For an XML (or XHTML) file, select File > Check Page > Validate as XML
- Otherwise, select File > Check Page > Validate Markup
- The Validation tab of the Results panel either displays a "No errors or warnings" message or lists the syntax errors it found
- Double-click an error message to highlight the error in the document
- To save the report as an XML file, click the Save Report button
- To view the report in your primary browser (which lets you print the report), click the Browse Report button
- You can set preferences for the Validator, such as specifying the tag-based languages against which the Validator should check, the specific problems that the Validator should check for, and the types of errors that the Validator should report
|
| |
| Making pages XHTML Compliant |
When you create a new page, you can make it XHTML-compliant. You can also make an existing HTML document XHTML-compliant. To create a new, XHTML-compliant document:
- Select File > New
- The New Document dialog box appears
- Select a category and type of page to create
- Select one of the XHTML document type definitions (DTD) from the Document Type (DTD) pop-up menu. For example, you can make an HTML document XHTML-compliant by selecting XHTML 1.0 Transitional or XHTML 1.0 Strict from the pop-up menu
- NOTE Not all document types can be made XHTML-compliant. Click OK
To create XHTML-compliant documents by default:
- Select Edit > Preferences or Dreamweaver > Preferences (Mac OS X) and select the New Document category
- In the New Document category, select a default document and select one of the XHTML document type definitions (DTD) from the Default Document Type (DTD) pop-up menu. For example, you can make an HTML document XHTML-compliant by selecting XHTML 1.0 Transitional or XHTML 1.0 Strict from the pop-up menu
- Click OK
To make an existing HTML document XHTML-compliant:
- Open a document, then do one of the following
- For a document without frames, select File > Convert, and then select one of the XHTML document type definitions. For example, you can make an HTML document XHTML-compliant by selecting XHTML 1.0 Transitional or XHTML 1.0 Strict from the pop-up menu
- For a document with frames, select a frame and select File > Convert, and then select one of the XHTML document type definitions. To convert the whole document, repeat this step for every frame and the frameset document
- NOTE: You can't convert an instance of a template, because it must be in the same language as the template on which it's based. For example, a document based on an XHTML template will always be in XHTML, and a document based on a non-XHTML-compliant HTML template will always be HTML and can't be converted to XHTML or any other language.
|
| |
|
|