Home » Tips-n-Tricks » How to Remove extra linebreaks and spaces in Dreamweaver

How to remove extra spaces

  1. While the document is open in Dreamweaver, press CTRL+F to load the Find & Replace dialog box. Do the search on the source code view.
  2. Check the box “Use regular expression” and uncheck any other boxes.
  3. Find: [\r\n]{2,}
  4. Replace: \n
  5. The hit “replace all”

That’s it!

However, take note that this method will remove any existing white space on your code.

Another thing. When you download the file again, Dreamweaver will add another white space on your code. Messing it up again. This is because of encoding and server type.

This usually happens if you are using Dreamweaver CS3 and your are downloading a file from a Unix/Linux server to a Windows based local PC.

Change Your Dreamweaver Settings to Prevent it

  1. Inside Dreamweaver, click Edit on the menu.
  2. Then Preferences.
  3. Then Code Format.
  4. Then on the “Line Break Type” select “LF (unix)”
  5. Click Ok. Done!

A thanks to Ryman from TechiBubble for wonderful tips :)

Array ( [0] => Tips-n-Tricks, XHTML Coding )

Leave a comment

0 Comments.

Leave a Reply

You must be logged in to post a comment.