SlideShare a Scribd company logo
1 of 12
CSS in 11 slides.
Good Type of Waterfall CSS uses the DOM <div id=“site”>  <h2>Big Header</h2>   <div class=“post”>    <h2>Title</h2>    <p>Text text text</p>   </div> <div class=“post”>     <h2>Title</h2>     <p>Text text text</p>   </div>   <div class=“post”>…</div> </div> h2{ font-weight: normal; color: green; } .post h2{ color: blue; } .site p { color: red; } div > p:first-child { color: purple; }
Cascading Style Sheets Reset CSS  *{…} Document-wide Style (DRY): body { font-size:			        12px } Most common type you’ll see/write Close second; hardest to track down. BAD.
.class vs. #id Same syntax (selectors, pseudo-classes, properties) a#fb { background: url(img/18px_sprites.png)   no-repeat -17px left; margin-right: 7px; } .carouselImage{ z-index:0; left:40px; position:relative; color:blue;} #id{}’s are unique to a page; singletons .classes come in groups (or at least can.) Why care? $(‘#fb’).fadeOut();
Real-world Example
Helpful Hints Open Source is Your Friend Firebug or Cmd+alt+I Margin vs. Padding (both increase the size of the box!!) Negative margin is bad.
Tools (cont.)
Block Model Block vis-à-vis in-line elements Block: <div>, <h#>, <table>, <form>, <(o|u)l> In-line: <img>, <a>, <i>, <b>, <u>, etc. You can redeclare as ….{ display: block; } :table-cell, etc.
“ “ Always Float: Left or :right, but never both Elements are floated horizontally; this means that an element can only be floated left or right, not up or down. A floated element will move as far to the left or right as it can. Usually this means all the way to the left or right of the containing element. --W3C Schools
The Internet Wants to Help (sort of) http://css-tricks.com/ http://net.tutsplus.com/ http://stackoverflow.com/ http://smashingmagazine.com/ http://unmatchedstyle.com/ http://www.w3schools.com/Css/default.asp http://lmgtfy.com/?q=background+image+css
One more thing…
Windows Sucks http://www.virtuosimedia.com/dev/css/ultimate-ie6-cheatsheet-how-to-fix-25-internet-explorer-6-bugs

More Related Content

What's hot

Firefox Extension Development | By JIIT OSDC
Firefox Extension Development | By JIIT OSDCFirefox Extension Development | By JIIT OSDC
Firefox Extension Development | By JIIT OSDCVaidik Kapoor
 
Quan Head Tag Presentation
Quan Head Tag PresentationQuan Head Tag Presentation
Quan Head Tag PresentationQuanslides
 
Google better with google, Updated 2014 01 05
Google better with google, Updated 2014 01 05Google better with google, Updated 2014 01 05
Google better with google, Updated 2014 01 05Wouter Gerritsma
 
Css, CaseCading Style Sheet
Css, CaseCading Style SheetCss, CaseCading Style Sheet
Css, CaseCading Style SheetIshaq Shinwari
 
Html tag html 10 x10 wen liu art 2830
Html tag html 10 x10 wen liu art 2830Html tag html 10 x10 wen liu art 2830
Html tag html 10 x10 wen liu art 2830Wen Liu
 

What's hot (9)

Firefox Extension Development | By JIIT OSDC
Firefox Extension Development | By JIIT OSDCFirefox Extension Development | By JIIT OSDC
Firefox Extension Development | By JIIT OSDC
 
Html1
Html1Html1
Html1
 
Mongo db onepage
Mongo db onepageMongo db onepage
Mongo db onepage
 
Quan Head Tag Presentation
Quan Head Tag PresentationQuan Head Tag Presentation
Quan Head Tag Presentation
 
Google better with google, Updated 2014 01 05
Google better with google, Updated 2014 01 05Google better with google, Updated 2014 01 05
Google better with google, Updated 2014 01 05
 
Css, CaseCading Style Sheet
Css, CaseCading Style SheetCss, CaseCading Style Sheet
Css, CaseCading Style Sheet
 
Intro to HTML
Intro to HTMLIntro to HTML
Intro to HTML
 
03 Getting Started
03 Getting Started03 Getting Started
03 Getting Started
 
Html tag html 10 x10 wen liu art 2830
Html tag html 10 x10 wen liu art 2830Html tag html 10 x10 wen liu art 2830
Html tag html 10 x10 wen liu art 2830
 

Similar to Introduction to CSS

Similar to Introduction to CSS (20)

1 03 - CSS Introduction
1 03 - CSS Introduction1 03 - CSS Introduction
1 03 - CSS Introduction
 
Embrace the Mullet: CSS is the 'Party in the Back' (a CSS How-to)
Embrace the Mullet: CSS is the 'Party in the Back' (a CSS How-to)Embrace the Mullet: CSS is the 'Party in the Back' (a CSS How-to)
Embrace the Mullet: CSS is the 'Party in the Back' (a CSS How-to)
 
CSS
CSSCSS
CSS
 
Css
CssCss
Css
 
Doing More with LESS for CSS
Doing More with LESS for CSSDoing More with LESS for CSS
Doing More with LESS for CSS
 
Webdesign
WebdesignWebdesign
Webdesign
 
Block2 Session2 Presentation
Block2 Session2 PresentationBlock2 Session2 Presentation
Block2 Session2 Presentation
 
CSS
CSSCSS
CSS
 
Jade & Javascript templating
Jade & Javascript templatingJade & Javascript templating
Jade & Javascript templating
 
HTML & CSS
HTML & CSSHTML & CSS
HTML & CSS
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
YL Intro html
YL Intro htmlYL Intro html
YL Intro html
 
ppt dev devolpment.pptx
ppt dev devolpment.pptxppt dev devolpment.pptx
ppt dev devolpment.pptx
 
5.2 nesting and floating elements
5.2 nesting and floating elements5.2 nesting and floating elements
5.2 nesting and floating elements
 
Advanced dreamweaver
Advanced dreamweaverAdvanced dreamweaver
Advanced dreamweaver
 
Critical Rendering Path
Critical Rendering PathCritical Rendering Path
Critical Rendering Path
 
AK css
AK cssAK css
AK css
 
lecture0.pdf
lecture0.pdflecture0.pdf
lecture0.pdf
 
Couch Db.0.9.0.Pub
Couch Db.0.9.0.PubCouch Db.0.9.0.Pub
Couch Db.0.9.0.Pub
 

Introduction to CSS

  • 1. CSS in 11 slides.
  • 2. Good Type of Waterfall CSS uses the DOM <div id=“site”> <h2>Big Header</h2> <div class=“post”> <h2>Title</h2> <p>Text text text</p> </div> <div class=“post”> <h2>Title</h2> <p>Text text text</p> </div> <div class=“post”>…</div> </div> h2{ font-weight: normal; color: green; } .post h2{ color: blue; } .site p { color: red; } div > p:first-child { color: purple; }
  • 3. Cascading Style Sheets Reset CSS *{…} Document-wide Style (DRY): body { font-size: 12px } Most common type you’ll see/write Close second; hardest to track down. BAD.
  • 4. .class vs. #id Same syntax (selectors, pseudo-classes, properties) a#fb { background: url(img/18px_sprites.png) no-repeat -17px left; margin-right: 7px; } .carouselImage{ z-index:0; left:40px; position:relative; color:blue;} #id{}’s are unique to a page; singletons .classes come in groups (or at least can.) Why care? $(‘#fb’).fadeOut();
  • 6. Helpful Hints Open Source is Your Friend Firebug or Cmd+alt+I Margin vs. Padding (both increase the size of the box!!) Negative margin is bad.
  • 8. Block Model Block vis-à-vis in-line elements Block: <div>, <h#>, <table>, <form>, <(o|u)l> In-line: <img>, <a>, <i>, <b>, <u>, etc. You can redeclare as ….{ display: block; } :table-cell, etc.
  • 9. “ “ Always Float: Left or :right, but never both Elements are floated horizontally; this means that an element can only be floated left or right, not up or down. A floated element will move as far to the left or right as it can. Usually this means all the way to the left or right of the containing element. --W3C Schools
  • 10. The Internet Wants to Help (sort of) http://css-tricks.com/ http://net.tutsplus.com/ http://stackoverflow.com/ http://smashingmagazine.com/ http://unmatchedstyle.com/ http://www.w3schools.com/Css/default.asp http://lmgtfy.com/?q=background+image+css

Editor's Notes

  1. IF YOU HAVE ONE TAKE-AWAY…