Your SlideShare is downloading. ×
CSS Nuggets
CSS Nuggets
CSS Nuggets
CSS Nuggets
CSS Nuggets
CSS Nuggets
CSS Nuggets
CSS Nuggets
CSS Nuggets
CSS Nuggets
CSS Nuggets
CSS Nuggets
CSS Nuggets
CSS Nuggets
CSS Nuggets
CSS Nuggets
CSS Nuggets
CSS Nuggets
CSS Nuggets
CSS Nuggets
CSS Nuggets
CSS Nuggets
CSS Nuggets
CSS Nuggets
CSS Nuggets
CSS Nuggets
CSS Nuggets
CSS Nuggets
CSS Nuggets
CSS Nuggets
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

CSS Nuggets

12,216

Published on

Published in: Technology, Sports
3 Comments
38 Likes
Statistics
Notes
  • good
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • GooD Method! I often meet Grids Problem, Thanks
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Great presentation, Anna! A few really nice tips there. Thanks!

    James
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
12,216
On Slideshare
0
From Embeds
0
Number of Embeds
30
Actions
Shares
0
Downloads
214
Comments
3
Likes
38
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. CSS Nuggets http://www.flickr.com/photos/twenty_questions/3491868827
  • 2. :first and :last http://www.flickr.com/photos/luiscdiaz/330340600
  • 3. :first-of-type Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus hendrerit. Pellentesque aliquet nibh nec urna. In nisi neque, aliquet vel, dapibus id, mattis vel, nisi. Sed pretium, ligula sollicitudin laoreet viverra, tortor libero sodales leo, eget blandit nunc tortor eu nibh. Nullam mollis. Ut justo. Suspendisse potenti. Sed egestas, ante et vulputate volutpat, eros pede semper est, vitae luctus metus libero eu augue. Morbi purus libero, faucibus adipiscing, commodo quis, gravida id, est. Sed lectus. Praesent elementum hendrerit tortor. Sed semper lorem at felis. Vestibulum volutpat, lacus a ultrices sagittis, mi neque euismod dui, eu pulvinar nunc sapien ornare nisl. Phasellus pede arcu, dapibus eu, fermentum et, dapibus sed, urna. Morbi interdum mollis sapien. Sed ac risus. Phasellus lacinia, magna a ullamcorper laoreet, lectus arcu pulvinar risus, vitae facilisis libero dolor a purus. Sed vel lacus. Mauris nibh felis, adipiscing varius, adipiscing in, lacinia vel, tellus. Suspendisse ac urna. p { font-size : 1em ; }
  • 4. :first-of-type Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Phasellus hendrerit. Pellentesque aliquet nibh nec urna. In nisi neque, aliquet vel, dapibus id, mattis vel, nisi. Sed pretium, ligula sollicitudin laoreet viverra, tortor libero sodales leo, eget blandit nunc tortor eu nibh. Nullam mollis. Ut justo. Suspendisse potenti. Sed egestas, ante et vulputate volutpat, eros pede semper est, vitae luctus metus libero eu augue. Morbi purus libero, faucibus adipiscing, commodo quis, gravida id, est. Sed lectus. Praesent elementum hendrerit tortor. Sed semper lorem at felis. Vestibulum volutpat, lacus a ultrices sagittis, mi neque euismod dui, eu pulvinar nunc sapien ornare nisl. Phasellus pede arcu, dapibus eu, fermentum et, dapibus sed, urna. Morbi interdum mollis sapien. Sed ac risus. Phasellus lacinia, magna a ullamcorper laoreet, lectus arcu pulvinar risus, vitae facilisis libero dolor a purus. Sed vel lacus. Mauris nibh felis, adipiscing varius, adipiscing in, lacinia vel, tellus. Suspendisse ac urna. p { font-size : 1em ; } p:first-of-type { font-size : 1.2em ; }
  • 5. :last-of-type Lorem ipsum Dolor sit amet Consectetuer adipiscing elit Phasellus hendrerit td { border-bottom : 1px solid pink ; }
  • 6. :last-of-type td { border-bottom : 1px solid pink ; } td:last-of-type { border-bottom : 1px solid gray ; } Lorem ipsum Dolor sit amet Consectetuer adipiscing elit Phasellus hendrerit
  • 7. Grid Layouts http://www.flickr.com/photos/22426181@N00/3651174488
  • 8. an ideal world .block .block .block .block .block .block Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros.
  • 9. the real world .block .block .block .block .block Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada.
  • 10. the workaround .block .block .block .block .block .block .wrapper .wrapper Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque volutpat mattis eros.
  • 11. the really bad workaround .block .block .block Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede. .block { height : 400px ; } Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio.
  • 12. the solution .block .block .block 4 .block 5 .block 6 .block 3 2 1 .block:nth-of-type(3n+1) { clear : both ; }
  • 13. what about margins? .block .block .block 3 2 1
  • 14. what about margins? .block .block .block 3 2 1 .block:nth-of-type(3n+3) { margin-right : 0 ; }
  • 15. it does that, and more .block .block .block .block .block .block
  • 16. here’s one I made earlier
  • 17. faux randomness .tag:nth-of-type(3n+1) { transform : rotate(2deg) ; } .tag:nth-of-type(5n+1) { transform : rotate(-2deg) ; }
  • 18. Shadows http://www.flickr.com/photos/varmlandspojk/4026394526
  • 19. shadows .block { box-shadow : 2px 2px 6px #333333 ; } .block
  • 20. inset shadows .block { box-shadow : inset 2px 2px 6px #333333 ; }
  • 21. each to its own -webkit-box-shadow -moz-box-shadow filter : shadow(color=gray, direction=100, strength=5) ; Safari Firefox Friggin’ IE
  • 22. Transform http://www.flickr.com/photos/stevedave/3566325269
  • 23. transform .block .block { transform : rotate(2deg) ; }
  • 24. transform .block .block { transform : rotate(2deg) ; padding : 3px ; background-color : white ; border : 1px solid gray ; box-shadow : 2px 2px 3px gray ; }
  • 25. Icons http://www.flickr.com/photos/piet_musterd/3294909186
  • 26. [attr] selectors
  • 27. filetype a[href$=’.pdf’], a[href$=’.PDF’] { background-image : url(../images/icons/pdf.gif) ; } $ means ends with
  • 28. external websites a[href*=”http://flickr.com”], a[href*=”http://www.flickr.com”] { background-image : url(../images/icons/flickr.gif) ; } * means contains
  • 29. Support http://www.flickr.com/photos/melissamaples/2887070187
  • 30. compatibility Firefox 3.5+ Safari 4.0 Chrome Konqueror Opera 10 Friggin’ IE http://www.quirksmode.org/css/contents.html

×