When does white space matter in HTML? (2016)
1–10 of 12 posts
Re: When does white space matter in HTML? (2016)
#2If using code to generate HTML then you can remove white space with Google's mod_pagespeed. This will only remove a certain amount and what remains either 'doesn't matter' or is something that needs fixing in templates.
I doubt there is a performance penalty for excessive white space but it is satisfying to be able to 'view source' for the document to be pretty printed with the exception of indentation. In my opinion source documents should be neat, otherwise might aw well just give up on HTML and go for some byte code HEX digit stream in a non-human-readable format.
Re: When does white space matter in HTML? (2016)
#3Re: When does white space matter in HTML? (2016)
#4Re: When does white space matter in HTML? (2016)
#5I just hate when the web browsers renders differently depending on if you have a line break between certain elements. Line breaks in HTML source code should not matter!
or ? How would you put in a line break on the rendered page? I suppose there's an argument to be made for not rendering line breaks as a space, but such a change to the HTML spec at this stage is probably not going to happen.
Re: When does white space matter in HTML? (2016)
#6Re: When does white space matter in HTML? (2016)
#7Re: When does white space matter in HTML? (2016)
#8I just hate when the web browsers renders differently depending on if you have a line break between certain elements. Line breaks in HTML source code should not matter!
So, should you put spaces at the end, or at the beginning of lines in text that's broken into multiple lines?
Re: When does white space matter in HTML? (2016)
#9Seriously, I genuinely cannot see a use case where this setup would make things better, and it's quite clear that in 95% of them it just makes things harder for web developers. Pretty much no one uses this to align anything, and any use cases I can see could be done better with margins.
Just ignore the spaces between inline-block elements and instruct browsers to strip them out.
Re: When does white space matter in HTML? (2016)
#10Who actually thought rendering the white space between inline-block elements was a good idea in the first place? Seriously, I genuinely cannot see a use case where this setup would make things better, and it's quite clear that in 95% of them it just makes things harder for web developers. Pretty much no one uses this to align anything, and any use cases I can see could be done better with margins. Just ignore the spa…
If you’re misusing inline-block for generic layout then you really should be looking at Flexbox and not trying to neuter the intended behaviour.