|
Posted by Andy Dingley on 07/12/06 11:25
devdixon wrote:
> Can anyone explain "white space" to me?
White space is what separates the "interesting stuff" apart.
- "White space" can be any white-space characater: space, tab,
linefeed or a few others, it doesn't matter.
- "White space" is often found in HTML, but rarely needed. Because
tags have clear stop and start characters ("<" and ">") then you can
usually manage without needing to deliberately space them apart with
whitespace.
- "White space" means a gap, it doesn't matter how big the gap is.
HTML doesn't care if you leave lots of spaces or just enough, it'll
render the same.
- "White space" is of varying significance, depending on the context
(even depending on the browser). In some places it doesn't matter if
you have any or not (between most tags) in some cases you have to avoid
having _any_ whitespace or you'll see annoying gaps appearing (most
infamously around <a> tags mixed with <li> or <img> tags).
The rest is in the W3C HTML spec. If you're starting to care about
these issues, you should be reading the real spec, not some bowdlerised
tutorial site version of it.
[Back to original message]
|