Home :
Stored Query to Remove CSS Comments
The comments in the CSS layouts that come with Dreamweaver CS3 are deliberately verbose—they’re there to help you understand what each rule is for. Although commenting style sheets is a good idea, you’ll probably want to get rid of the Dreamweaver comments once you’re familiar with the layouts. This stored query can be loaded into the Dreamweaver Find & Replace dialog box to remove all or some of the comments quickly and cleanly.
Download stored query to remove CSS comments
Instructions for use
- Open the style sheet in the Document window. If the styles are embedded in the
<head>of the document, switch to Code view. - Launch Find & Replace from the Edit menu (or press Ctrl+F/Cmd+F).
- Click the Load Query icon at the top right of the Find and Replace dialog box.
- In the Load Query dialog box, select
css_comments_remove.dwr, and click Open. This loads the query into the Find and Replace dialog box and sets all the necessary options as shown here.
- To remove all the CSS comments in a single operation, click Replace All. This removes all comments, including any CSS hacks that look like comments. If you’re in any way uncertain, use the following more selective approach.
To remove comments selectively, click Find Next to highlight the first one. Click Replace to remove it or Find Next to move to the next one.
Dreamweaver always remembers your last find and replace operation, so these settings will be displayed the next time you open the Find & Replace panel. Delete the regular expression from the Find field and deselect the Use regular expression check box (unless you plan to use another regex). This final point is very important. When a find operation fails for no obvious reason, it’s usually because you have selected the Use regular expression check box by accident.


