CSS Suck?
a bit.
"Specificity is a type of weighting that has a bearing on how your cascading style sheet (CSS) rules are displayed"
Add 1 for each element and pseudo-element, add 10 for each attribute, class and pseudo-class, add 100 for each ID; and add 1000 for an inline style.
Abstract the structure of the block from the skin which is being applied
#button {
width: 200px;
height: 50px;
padding: 10px;
border: solid 1px #ccc;
background: linear-gradient(#ccc, #222);
box-shadow: rgba(0, 0, 0, .5) 2px 2px 5px;
}
#box {
width: 400px;
overflow: hidden;
border: solid 1px #ccc;
background: linear-gradient(#ccc, #222);
box-shadow: rgba(0, 0, 0, .5) 2px 2px 5px;
}
#widget {
width: 500px;
min-height: 200px;
overflow: auto;
border: solid 1px #ccc;
background: linear-gradient(#ccc, #222);
box-shadow: rgba(0, 0, 0, .5) 2px 2px 5px;
}
.button {
width: 200px;
height: 50px;
}
.box {
width: 400px;
overflow: hidden;
}
.widget {
width: 500px;
min-height: 200px;
overflow: auto;
}
.skin {
border: solid 1px #ccc;
background: linear-gradient(#ccc, #222);
box-shadow: rgba(0, 0, 0, .5) 2px 2px 5px;
}
Break the dependency between the container module and the container objects it contains
CSS Reduced by 19%
HTML Reduced of 50%
Css Preprocessor like SASS [Mixins and Extend]
CSS Frameworks based on OOCSS Approach