Search code examples
htmlcssmarkup

When "viewing source", some sites have neat markup, some sites don't. Why? (pic attached)


Ugly and Neat Markup

Notice how in the 'ugly' side, the doctype is all the way indented and some of the meta lines extend past the left indent.

How can I get my markup looking neat when viewing source in a browser? Is there a certain way to encode the code while using an editor? I use Notepad++ by the way.


Solution

  • Large blocks of unindented code like you see in the left hand side are probably being written out server side, and so although the tag that creates them is nicely indented in your HTML the erver script output will not honour that.