Forum Moderators: open
When a table is written in Notepad for example and you have hit return after a <td> tag like:
<td>
<img src="logo.jpg">
</td>
Will that break in line after the <td> tag show up as white space around the image. I have heard some one calling it "White space in your code." Just all the books, tutorials, sites and forums that I have ever read, it has never mentioned anything like this at all.
Hope some one can clear this up for me!
:)
I just had ago myself and its only the closing tag </td> that has to be on the same line, not the opening one <td> as well.
Well I learn something new everyday... the adventure continues!
CSS & image gaps [webmasterworld.com]
In addition to what pageoneresults said, it is also poor syntax to "hit return" when writing any code. Not only does this habit add white space, but most editors (and thusly the browser) terminate the line. This can cause scripting errors and other problems, including those spaces around images.
Instead of hitting the return key, use your space bar.
<td>
<img src="logo.jpg"><br>
</td>
A similar thing happens with code like this:
<a href="index.html">
Home
</a>
Netscape browsers will make the space after the text part of the link. This is especially ugly with code like:
<a href="index.html">
<img src="home.gif" alt="Home" />
</a>
Here, you get the button with a little clickable _ next to it -- a blemish on your otherwise beautiful site.