View Full Version : Dreamweaver adding spaces in my code

04-11-2011, 02:19 AM
In code view I have a bunch of images all on separate lines. For some reason dream weaver is adding a couple of spaces between the images, Like this:

<img src="../images/fmc/fmc_01.png">
<img src="../images/fmc/fmc_02.png">
<img src="../images/fmc/fmc_03.png">

There must be some auto formatting happening but I don't know how to change it.

The only way to remove the spaces is to have the code for the images back to back, Like this:

<img src="../images/fmc/fmc_01.png"><img src="../images/fmc/fmc_01.png"><img src="../images/fmc/fmc_01.png">

This is a pain. Anyone know how to change this?

04-11-2011, 04:13 AM
Nor sure I see the problem..when displayed in the browser the result will be the same.. why do you want the code on the same line.


04-11-2011, 04:40 AM
I dont want the code on the same line. Its much easier to deal with, read and edit if they are on separate lines of code.

The problem is, in the browser it does not display the same. It should. The images should line up next to each other in the browser no matter if the code is side by side or if I spread things out in the code.

I think dreamweaver has some sort of setting thats creating spaces when I drop the code to separate lines.

04-11-2011, 06:04 AM
show the actual code where it appears on separate lines, it should make no difference

04-11-2011, 06:07 AM
The images as you have them coded on separate lines are spacing one character apart from each other because by default the browsers will render this one space whenever there is empty space in the code of a positioning element. The best (and proper) way to handle images is to utilize CSS to position them.
Ed, I stand corrected?

04-11-2011, 06:18 AM
no it looks like i do. i will have to try this as ive not come across it before to be honest. because they are on new lines it shouldn't add spaces i would say

04-11-2011, 06:21 AM
no i tried to be sure and it made no difference (in ff at least) i asked the code incase they were in paragraph tags

04-11-2011, 06:23 AM
If those images are inside a <p> container, which I'm assuming here, that behavior would occur for sure...

04-11-2011, 06:24 AM
This is amusing, we're posting within seconds... They gotta be in p's...

04-11-2011, 09:45 AM
I did a test too and I noticed also that if they are on the same line in code view the space between them disappears (I've tested only in Firefox by the way).
I'm not sure why's that. I zeroed out the margin, but still. The only fix I could came up with is to add a float: left to the img tag in the CSS.