本文主要包含css3动画效果,css3阴影效果,css3过渡效果,css3效果,css3鼠标悬停效果等相关知识,佚名 希望在学习及工作中可以帮助到您
这效果看起来挺炫,但原理并不复杂,能实现一片花瓣动起来,就能实现9片花瓣。效果的叠加而已。
HTML:
<!doctype html> <html> <head> <meta charset="utf-8"> <title></title> <meta name="robots" content="noindex, nofollow"> <link rel="canonical" href="http://cssdeck.com/labs/ua52kzsu"> <style> * { margin: 0; padding: 0; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } html, body, iframe { width: 100%; height: 100%; } body { overflow: hidden; } iframe { border: 0 none; padding-top: 30px; } header {overflow: hidden;} header { height: 30px; max-height: 30px; width: 100%; position: absolute; background: #3c404b; border-bottom: 1px solid #000; } /* Logo */ .logo { width: 60px; float: left; box-shadow: 8px 20px 18px -2px rgba(0, 0, 0, 0.22); } .logo a { text-indent: -9999px; display: block; text-decoration: none; border: none; outline: none; background: url(https://dl.dropbox.com/u/26141789/logoTop.png) 50% 50% no-repeat; height: 30px; width: 60px; } /* Navigation */ .top_nav, .extra { float: left; padding: 0; margin: 0; list-style: none; } .extra { float: right; margin-right: 1px; } .top_nav li, .extra li { float: left; position: relative; } .top_nav li a, .extra li a { height: 30px; display: block; text-align: center; font: 12px/30px "Open Sans", Arial, sans-serif; color: #efefef; text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.22); text-decoration: none; padding: 0 25px; overflow: hidden; position: relative; } .top_nav > li > a, .extra > li > a, .logo a { -webkit-transition: all .3s ease; -moz-transition: all .3s ease; transition: all .3s ease; } /* header has overflow: hidden which won't let dropdown appear. So why not use my amazing skills and write the worst hacks ever! */ .top_nav > li > a:before, .extra > li > a:before { position: absolute; width: 100%; content: ''; height: 30px; box-shadow: 8px 12px 18px -2px rgba(0, 0, 0, 0.22); top: 0; left: -100%; } header li.user_menu > a { padding: 5px 10px 0; background: #333; } header li:hover > a, header li a:hover, .logo a:hover{ background-color: rgba(0, 0, 0, .5); } </style> <body> <header> <ul class="extra" style="float: right;"> <li><a href="http://twitter.com/share?text=Full view for &via=cssdeck" target="_blank">Tweet</a></li> <li><a href="/labs/ua52kzsu/0">Edit in Labs</a></li> </ul> </header> <iframe src="http://secure.cssdeck.com/labs/full/ua52kzsu/0/noframe#dontkillanim"></iframe> <script> window.__stop_animations = false; </script> </body> </html>
提示:您可以先修改部分代码再运行</div> </div>
HTML:
<!doctype html> <html> <head> <meta charset="utf-8"> <title></title> <meta name="robots" content="noindex, nofollow"> <link rel="canonical" href="http://cssdeck.com/labs/ua52kzsu"> <style> * { margin: 0; padding: 0; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } html, body, iframe { width: 100%; height: 100%; } body { overflow: hidden; } iframe { border: 0 none; padding-top: 30px; } header {overflow: hidden;} header { height: 30px; max-height: 30px; width: 100%; position: absolute; background: #3c404b; border-bottom: 1px solid #000; } /* Logo */ .logo { width: 60px; float: left; box-shadow: 8px 20px 18px -2px rgba(0, 0, 0, 0.22); } .logo a { text-indent: -9999px; display: block; text-decoration: none; border: none; outline: none; background: url(https://dl.dropbox.com/u/26141789/logoTop.png) 50% 50% no-repeat; height: 30px; width: 60px; } /* Navigation */ .top_nav, .extra { float: left; padding: 0; margin: 0; list-style: none; } .extra { float: right; margin-right: 1px; } .top_nav li, .extra li { float: left; position: relative; } .top_nav li a, .extra li a { height: 30px; display: block; text-align: center; font: 12px/30px "Open Sans", Arial, sans-serif; color: #efefef; text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.22); text-decoration: none; padding: 0 25px; overflow: hidden; position: relative; } .top_nav > li > a, .extra > li > a, .logo a { -webkit-transition: all .3s ease; -moz-transition: all .3s ease; transition: all .3s ease; } /* header has overflow: hidden which won't let dropdown appear. So why not use my amazing skills and write the worst hacks ever! */ .top_nav > li > a:before, .extra > li > a:before { position: absolute; width: 100%; content: ''; height: 30px; box-shadow: 8px 12px 18px -2px rgba(0, 0, 0, 0.22); top: 0; left: -100%; } header li.user_menu > a { padding: 5px 10px 0; background: #333; } header li:hover > a, header li a:hover, .logo a:hover{ background-color: rgba(0, 0, 0, .5); } </style> <body> <header> <ul class="extra" style="float: right;"> <li><a href="http://twitter.com/share?text=Full view for &via=cssdeck" target="_blank">Tweet</a></li> <li><a href="/labs/ua52kzsu/0">Edit in Labs</a></li> </ul> </header> <iframe src="http://secure.cssdeck.com/labs/full/ua52kzsu/0/noframe#dontkillanim"></iframe> <script> window.__stop_animations = false; </script> </body> </html>
提示:您可以先修改部分代码再运行</div> </div>