By glenstansberry
via nettuts.com
Published: Aug 26 2008 / 07:12
These CSS tips are gathered from some of the most respected designers on the planet. They have the portfolios to back their advice up, so you'll know that each tidbit of advice is of the highest quality.
Comments
Rob Signorelli replied ago:
Gotta say that I can't get on board with number 2. Keep it all on 1 line? How is that easier to scan than putting the declarations on separate lines? On separate lines it's easier to tell where one declaration starts and one ends, especially when one of the declarations is a rather verbose one like a background definition. Also, how does this save you any characters? In their example, you're using the same number of characters -- except that in one you're using spaces and newlines in the other. Sorry to nitpick that one item, but this one seemed really out of place from the rest of the list.
jp0p replied ago:
I agree Rob. The only time I keep declarations on one line is if it is a single rule. It helps to save a little scrolling in your CSS file. #example {padding:10em;}
dragmire replied ago:
I don't agree with 4 or 5, and I think 2 is a little too invasive of personal coding decisions to be a "principle"
ahot replied ago:
My comment wasn't published on that page.
I just want to add something to 2: why don't he say about making class names short? It can save more traffic :)
BTW, Rob, you are right, space character can be equal newline character!
jp0p, you are right too. Now I think that they mean only scrolling size.
Voters For This Link (31)
Voters Against This Link (0)