Difference between revisions of "HTML/CSS"
Jump to navigation
Jump to search
Line 2: | Line 2: | ||
=== Specificity === | === Specificity === | ||
− | p has a specificity of 1 (1 HTML | + | p has a specificity of 1 (1 HTML) |
− | div p has a specificity of 2 (2 HTML | + | div p has a specificity of 2 (2 HTML; 1+1) |
− | .sith has a specificity of 10 (1 class | + | .sith has a specificity of 10 (1 class) |
− | div p.sith has a specificity of 12 (2 HTML | + | div p.sith has a specificity of 12 (2 HTML and a class; 1+1+10) |
− | #sith has a specificity of 100 (1 id | + | #sith has a specificity of 100 (1 id) |
− | body #darkside .sith p has a specificity of 112 (HTML | + | body #darkside .sith p has a specificity of 112 (HTML, id, class, HTML; 1+100+10+1) |
+ | [http://www.htmldog.com/guides/cssadvanced/specificity/] [http://www.stuffandnonsense.co.uk/archives/css_specificity_wars.html] ([http://www.stuffandnonsense.co.uk/archives/images/specificitywars-05v2.jpg]) | ||
=== Positioning === | === Positioning === |
Revision as of 16:38, 10 March 2012
Specificity
p has a specificity of 1 (1 HTML) div p has a specificity of 2 (2 HTML; 1+1) .sith has a specificity of 10 (1 class) div p.sith has a specificity of 12 (2 HTML and a class; 1+1+10) #sith has a specificity of 100 (1 id) body #darkside .sith p has a specificity of 112 (HTML, id, class, HTML; 1+100+10+1)
Positioning
display: block - default 100% width, flows vertically display: inline - consumes width of content, flows horizontally display: inline-block http://www.quirksmode.org/css/display.html
float - floats element next to containing box or other floated element
position: absolute - out of flow
rgba(0, 0, 0, 0.2) - shadow
Tips
background
Resets, etc.
Grid
- http://blog.centresource.com/2009/06/15/6-tips-and-tricks-for-designing-with-960/
- http://divitodesign.com/css/tricks-to-solve-960-css-framework-problems/
Vertical rhythm
- The Elements of Typographic Style Applied to the Web
- http://24ways.org/2006/compose-to-a-vertical-rhythm - oft' linked to
- https://github.com/pyrsmk/vertical-rhythmic - sass mixins (no sure if worth it)
Typography
- CSS with vertical rhythm - drewish.com
- Scale & Rhythm