//STYLE: Avoid long lines

Break up long lines for easier legibility and printability

Some of you have noticed how irritating it is to code when you have lines that go off the edge of the screen.

One of the cool things about HTML is that you can hit Enter anywhere in your code, and the browser will ignore it.

This means that if a line is running off the edge of the screen, you can break it up into one phrase or sentence per line in your code without it affecting the look of how your web page is displayed.

This makes it much easier to follow the flow of code, and has the added bonus of not cutting things off or shrinking everything when you print.

There is such a thing a "wrap long lines" in your text editors, but that does not help you with printing.

The classroom style I use for marking is to end at the 96th character position, or the length of a line of code in the printed version of the "View source" function of Chrome.

Live example: Avoid long lines of code