Is there a convention for the width of code in HTML? Some of my lines is getting really long (due to attributes) and it's very hard to look at everything.
Thanks.
Is there a convention for the width of code in HTML? Some of my lines is getting really long (due to attributes) and it's very hard to look at everything.
Thanks.
Many agree 79-80 columns as the magic number. Of course this is up to you and your coworkers. Also keep in mind some day someone other than you all might have to come in and refactor this.
Related question: Is there a valid reason for enforcing a maximum width of 80 characters in a code file, this day and age?
Note: When it comes to HTML
I don't mind if the line is a bit long, especially when you have nested div
, lines can start to get a little far off of the left margin.
I use a width of 120 characters per line.
As a rule for myself, if the line exceeds 120 then it can probably be written better in some cases, meaning possibly removing some attributes that are defined into a style in a stylesheet.
At the end of the end the day, as long I PERSONALLY am happy with what i see. And I can understand it fine without having to scroll here and there to see whats going on... Then thats fine as far as i'm concerned.
With regards to future readers/editors of the material, I will let them worry about how THEY wish to format the information based up in thier OWN PERSONAL editing styles!