CSS in a single line
Just like with other code, css is most often broken up in a particular way to make it easier to comprehend. Until recently I had only seens CSS written in the block formation that most of us are probably really accustomed to. then some people I know started writing there css all on one line without spaces.
I really did not much like it it when I first saw it. It kinda looked jumbled and confusing, but I seemed to be seeing more and more CSS written this way everyday with people exclaiming that it was a far easier way to read through css code.
It also seems that may immediate reaction was not very unusual. It seems most people did not fall in love with it right away, but shortly did come to see that there were indeed some advantages. and you know what, so did I!
so what are the advantages?
so far to me the main one is the huge reduction in the amount of scrolling i have to do. If you think about it, I bet you will realize that you do a lot of scrolling to pass up all those narrow columns of code and get to what you are looking for.
So in short, this:
#wrapper {
width:800px;
margin:0 auto;
}
#header {
height:100px;
position:relative;
}
#feature .post {
width:490px;
float:left;
}
#feature .link {
width:195px;
display:inline;
margin:0 10px 0 0;
float:right;
}
#footer {
clear:both;
font-size:93%;
float:none;
}
becomes this:
#wrapper {width:800px; margin:0 auto;}
#header {height:100px; position:relative;}
#feature .post {width:490px; float:left;}
#feature .link {width:195px; display:inline; margin:0 10px 0 0; float:right;}
#footer {clear:both; font-size:93%; float:none;}
No comments:
Post a Comment