A single file can also be organized into these sections.
Resulting CSS files:
layout.csscolor.csstype.cssIE (6/7)Printetc.
A single file can also be organized into these sections.
No section or page-based css!Site sections can be handled within each file.
Old news? Everybody does it this way? Nope.
IE code in separate files.Use conditional comments to include these files.
Pamela Anderson comment
<!-- Pamela Anderson -->
IE conditional comment
<!--[if lt IE 7]>(...)
<![endif]-->
Pamela Anderson comment
<!-- Pamela Anderson -->
IE conditional comment
<!--[if lt IE 7]>(...)
<![endif]-->
Use version control.
authoring.css
focus .more .here
{focus: less-here;}
focus .more .here {focus: less-here;}
Maintainable css startswith maintainable html.And semantic html = maintainable html.
Avoid placing css in themarkup.
Frameworks can bea problem.css Frameworks are made for ease of development,not for maintainability.
Frameworks fill html with layout code
Framework classes areoften meaningless outsidethe context of theframework.This demands knowledge of the specific framework,which decreases maintainability.
The Rule of Portable Meaning
ids identifyclasses classify
Marking up a web designer
<li
class="designer" id="andy"
>Andy Clarke</li>
This list item has portable meaning.Microformats have portable meaning.
Marking up a web designer
<li class="designer"
id="andy"
>Andy Clarke</li>
This list item has portable meaning.Microformats have portable meaning.
Marking up a web designer
<li class="designer" id="andy">Andy Clarke</li>
This list item has portable meaning.Microformats have portable meaning.
Marking up a web designer
<li class="designer" id="andy">Andy Clarke</li>
This list item has portable meaning.Microformats have portable meaning.
Use the cascade.Be specific only when necessary.This will simplify your css.
Understand css specificity.Helps when working with someone else’s code.
a ‖ b ‖ c ‖ d = specificity
inline ‖ IDs ‖(pseudo−) classes/attributes ‖ elements