Home › Forums › CSS › how to write single line css › Re: how to write single line css
September 23, 2008 at 4:51 pm
#49966
Member
It’s good to hear that the standard seems to be that there is no standard. After looking at many examples of how people lay out their style sheets, I came to the decision long ago to use a combination of both styles depending on which is the most readable (to me) for the given tag.
Along those lines I also add whitespace:
Code:
P.main { color: #000000; text-align: left; }
opposed to:
Code:
P.main{color:#000000;text-align:left;}
and indent two spaces when using the other format:
Code:
P.main {
color: #000000;
text-align: left;
}
color: #000000;
text-align: left;
}
I’m sure that there must be an impact on loading time but I would hope it is negligible. Imo, the time the readability saves me is well worth a minor hit in file size.