OOCSS
(OOCSS) Object Oriented CSS is a methodology for organising and extending CSS.
Principles
- Separate structure and skin.
- Separate container and content.
can be achieved if we use "class" selectors alone
class="structure-class skin-class"
class="base-class extend-class"
<style>
.mod .hd { /* some rules */ }
.mod .bd { /* some rules */ }
</style>
---
<div id="sidebar">
<div class="mod">
<h3 class="hd">heading</h3>
<p class="bd">content</p>
</div>
</div>
<style>
.mod .hd { /* some rules */ }
.mod .bd { /* some rules */ }
</style>
---
<div id="sidebar">
<div class="mod">
<h2 class="hd">heading</h3>
<p class="bd">content</p>
</div>
</div>
Double-stranded heading hierarchy
practice of defining a class every time you define a heading in CSS.
<style>
h1, .h1 { /* some rules */ }
h2, .h2 { /* some rules */ }
...
h6, .h6 { /* some rules */ }
</style>
media Object
The media object is an image to the left, with descriptive content to the right