Your SlideShare is downloading. ×
0
CSS金矿
CSS金矿
CSS金矿
CSS金矿
CSS金矿
CSS金矿
CSS金矿
CSS金矿
CSS金矿
CSS金矿
CSS金矿
CSS金矿
CSS金矿
CSS金矿
CSS金矿
CSS金矿
CSS金矿
CSS金矿
CSS金矿
CSS金矿
CSS金矿
CSS金矿
CSS金矿
CSS金矿
CSS金矿
CSS金矿
CSS金矿
CSS金矿
CSS金矿
CSS金矿
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金矿

6,328

Published on

simply translate to http://www.slideshare.net/maban/css-nuggets …

simply translate to http://www.slideshare.net/maban/css-nuggets
thank's the creator Anna Debenham.

Published in: Design
4 Comments
12 Likes
Statistics
Notes
No Downloads
Views
Total Views
6,328
On Slideshare
0
From Embeds
0
Number of Embeds
12
Actions
Shares
0
Downloads
171
Comments
4
Likes
12
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 金矿 http://www.flickr.com/photos/twenty_questions/3491868827
  • 2. :first 与 :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. 网格布局 http://www.flickr.com/photos/22426181@N00/3651174488
  • 8. 一个理想的世界 .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. 现实世界 .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. 变通方案 .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. 的确很差的变通方案 .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. 解决方案 .block .block .block 4 .block 5 .block 6 .block 3 2 1 .block:nth-of-type(3n+1) { clear : both ; }
  • 13. Margin 怎么样呢 ? .block .block .block 3 2 1
  • 14. margin 怎么样呢 ? .block .block .block 3 2 1 .block:nth-of-type(3n+3) { margin-right : 0 ; }
  • 15. 它能做的,不只是这些 .block .block .block .block .block .block
  • 16. 这是我之前做的
  • 17. 伪随机性 .tag:nth-of-type(3n+1) { transform : rotate(2deg) ; } .tag:nth-of-type(5n+1) { transform : rotate(-2deg) ; }
  • 18. 阴影 http://www.flickr.com/photos/varmlandspojk/4026394526
  • 19. 阴影 .block { box-shadow : 2px 2px 6px #333333 ; } .block
  • 20. 内阴影 .block { box-shadow : inset 2px 2px 6px #333333 ; }
  • 21. 各自的 -webkit-box-shadow -moz-box-shadow filter : shadow(color=gray, direction=100, strength=5) ; Safari Firefox 该死的 IE
  • 22. 变形 http://www.flickr.com/photos/stevedave/3566325269
  • 23. 变形 .block .block { transform : rotate(2deg) ; }
  • 24. 变形 .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] 选择器
  • 27. 文件类型 a[href$=’.pdf’], a[href$=’.PDF’] { background-image : url(../images/icons/pdf.gif) ; } $ 意思是以 * 结束
  • 28. 外部网站 a[href*=”http://flickr.com”], a[href*=”http://www.flickr.com”] { background-image : url(../images/icons/flickr.gif) ; } * 意思是包含
  • 29. 支持 http://www.flickr.com/photos/melissamaples/2887070187
  • 30. 兼容性 Firefox 3.5+ Safari 4.0 Chrome Konqueror Opera 10 该死的 IE http://www.quirksmode.org/css/contents.html

×