I'm assuming you are referring to the way the code is indented and line spaced if you copy and paste it or if you write a snippet of several long lines.
Which editor are you using ?
If you're just playing with conceptual code in Notepad (for example), turning Wordwrap on (click Format on the top toolbar then click Wordwrap)limits how much code can fit on one line depending on the size of the Notepad window.
Simple text editors like Arachnophilia click here (my personal favourite for web and programming code) automatically limit how many characters fit onto one line as does the excellent HTML Kit click here
If the indenting/line spacing is not your issue or you are using another editor, post again and more details will follow.