Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Do any browsers (Internet Explorer in particular) have bugs relating to the length of a line in HTML source code?

Assuming the source code is being optimised for HTML parsers/renderers and not for readability, and assuming any presentation/content whitespace has already been catered for, is there any reason to include line breaks between tags?

share|improve this question

1 Answer 1

Most browsers typically use any whitespace as a separator (1 or more whitespaces is treated the same as just one). It should not matter to the browser if there are no line breaks or carriage returns.

Edit:

While we cannot speak for all browsers and how they are implemented, let's look at the HTML 4 spec, Section 9.1 for whitespace:

Note that a sequence of white spaces between words in the source document may result in an entirely different rendered inter-word spacing (except in the case of the PRE element). In particular, user agents should collapse input white space sequences when producing output inter-word space. This can and should be done even in the absence of language information (from the lang attribute, the HTTP "Content-Language" header field (see [RFC2616], section 14.12), user agent settings, etc.).

The PRE element is used for preformatted text, where white space is significant.

So in the vast majority of cases, if the browser is complaint with the spec, then it should render it how the spec describes (of course, the browser vendors have been known to use creative interpretation over time.)

share|improve this answer
    
Well of course it should not matter, but the question is: does it? –  Nick Whaley Apr 2 '13 at 3:43
    
I would count the whitespace mentioned in Section 9.1 as presentation/content whitespace –  Tim Apr 2 '13 at 4:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.