PDA

View Full Version : Prettier HTML Source Code


drewprops
2005-12-20, 00:05
I've noticed when viewing the source code of websites that I've created using PHP that the tags don't lay out nice and pretty as I'd expect... they run together in one big clump. I'm looking at the source code of other, more accomplished web designers and note that their HTML lays out very nicely. What am I missing...linefeeds? I'm asking instead of experimenting because I'm curious as to what standard practice is. I can provide links to a site that I've made if necessary (I expect that it isn't).

chucker
2005-12-20, 00:07
Sounds like what you want to do is add a few "\n"s for linebreaks, "\n\n"s for carriage returns and "\t"s for tabs. :)

drewprops
2005-12-20, 00:16
crap. of course I do. GAH, I'm so STO0pId. ::hitting head with fists, Chris Farley style::

chucker
2005-12-20, 00:18
You're welcome. ;)

ast3r3x
2005-12-20, 00:20
Sounds like what you want to do is add a few "\n"s for linebreaks, "\n\n"s for carriage returns and "\t"s for tabs. :)

Actually it's

\n for a linebreak or linefeed

\r for a carriage return

:D

chucker
2005-12-20, 00:36
Actually it's

\n for a linebreak or linefeed

\r for a carriage return

:D

Well, technically, yes. But you wouldn't want to use \r when outputting HTML. ;)