Forum Moderators: open

Message Too Old, No Replies

Vertical Space between Gifs

         

peterinwa

6:56 pm on Jan 24, 2004 (gmt 0)

10+ Year Member



I just discovered the oddest thing. It can make a difference in the appearance of your page whether or not you enter HTML code all on one line or break it into multiple lines with your text editor.

The following code places vertical space between the two gifs:

<img src='pic1.gif' width=50 height=75 border=0>
<br>
<img src='pic2.gif' width=50 height=75 border=0>

The following code is identical to the above except that it was all entered on a single line. It does NOT place vertical space between the two gifs:

<img src='pic1.gif' width=50 height=75 border=0><br><img src='pic2.gif' width=50 height=75 border=0>

I have never read that how you enter text with your text editor should make ANY difference to the appearance of your page. Am I missing something?

Thanks, Peter

DrDoc

7:18 pm on Jan 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The space is about three pixels, right?
That's because you have a character between the image and the break, albeit a space... but it's a space nonetheless.

For example, if I ut this in my code:

foo
bar
<br>

...that will leave a space between foo and bar, right?

Since images rest on the baseline by default, you will get a small space underneath the image (leaving room for the descenders on letters like pgjq)...

Hope that explains it :)

peterinwa

7:25 pm on Jan 24, 2004 (gmt 0)

10+ Year Member



That does make sense when you put it that way as you automatically get a space between the last character of one line of text and the first char of the next line. Just never thought about it that way.

Now that I understand I see that the same thing of course occurs between a gif and text. This is great... I use gifs for paragraph headings and this will allow me to get rid of that extra white space I always have between the gif and the start of the paragraph text.

I've been coding in HTML for years. Makes me wonder what else I've missed! Haha.

Thanks, Peter