Use soft tabs with 4 spaces.
Do not use the !important
declaration unless no reasonable alternative exists.
Do not use the universal selector (*
) unless no reasonable alternative exists.
No
font-family:"Helvetica Neue";
Yes
font-family:'Helvetica Neue';
No
background:url(../../images/some/image.jpeg);
Yes
background:url('../../images/some/image.jpeg');
No
.MYCLASS {
width:100%;
}
.Myclass {
width:100%;
}
.myClass {
width:100%;
}
.my_class {
width:100%;
}
.myclass {
width:100%;
}
Yes
.my-class {
width:100%;
}
No
p, a, div, span {
width:100%;
}
Yes
p,
a,
div,
span {
width:100%;
}
No
p { width:100%; height:100%; }
Yes
p {
width:100%;
height:100%;
}
/*==============================================================================
Major Section Name - Description of major section
==============================================================================*/
/*
Minor Section Name
---------------------------*/
/* Sub-Section Name */
No
a {
width:100%;
}
p {
height:100%;
}
Yes
a {
width:100%;
}
p {
height:100%;
}
No
#parent .wrapper .container span .item {
width:100%;
}
Yes
#parent .item {
width:100%;
}
No
a.link {
width:100%;
}
Yes
.link {
width:100%;
}