Ignore whitespace in HTML
Posted
by IP
on Stack Overflow
See other posts from Stack Overflow
or by IP
Published on 2010-04-13T08:30:47Z
Indexed on
2010/04/13
8:33 UTC
Read the original article
Hit count: 589
Is there anything in HTML/CSS that tells the browser to ignore whitespace completely?
So many times when you want to put, say, two images next to each other - you try desperately to keep the HTML readable, but the browser puts a space between them.
So instead of something like this:
<imc src="images/minithing.jpg" alt="my mini thing" />
<imc src="images/minithing.jpg" alt="my mini thing" />
<imc src="images/minithing.jpg" alt="my mini thing" />
<imc src="images/minithing.jpg" alt="my mini thing" />
you end up with this
<imc src="images/minithing.jpg" alt="my mini thing" /><imc src="images/minithing.jpg" alt="my mini thing" /><imc src="images/minithing.jpg" alt="my mini thing" /><imc src="images/minithing.jpg" alt="my mini thing" />
Which is just so horrible!
© Stack Overflow or respective owner