Tuesday, 15 February 2011

css - How do line breaks in your HTML affect your resulting page's spacing? -



css - How do line breaks in your HTML affect your resulting page's spacing? -

i noticed in index.php file if do:

<a href=""></a> <a href=""></a>

versus

<a href=""></a><a href=""></a>

there's more of space between 2 when utilize line-break. can read more on this?

in html specifications, number of white space becomes single white space when displayed.

doing:

<a href=""></a> <a href=""></a>

is identical to

<a href=""></a> <a href=""></a>

or number of carriage returns or spaces inbetween.

if don't have white space, 2 run each other. allows things such bolding in middle of word.

edit

thanks insertusernamehere, exact location in html 4.01 specification at:

http://www.w3.org/tr/html401/struct/text.html#h-9.1

in particular, part says:

note sequence of white spaces between words in source document may result in exclusively different rendered inter-word spacing (except in case of pre element). in particular, user agents should collapse input white space sequences when producing output inter-word space.

html css

No comments:

Post a Comment