麦创网

发表于 13/8/30 09:34:21 |显示全部楼层
本帖最后由 MemacX 于 2013-8-30 09:35 编辑

今天浏览网页,看到个很不错的效果(本人不会配色,估计色彩搭配好点效果更佳),想了想,就把它彷过来了。虽然现在IE对CSS3的支持是个很纠结的事情,但是我们更应该看到CSS3在一些高级浏览器中的突出表现,所以让我们忍受IE生硬的同时,感受高级浏览器的平滑。

效果预览: http://www.seejs.com/demos/fashion-nav/


  1. <!DOCTYPE HTML>

  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>很炫的导航</title>
  6. <style>
  7. .nav{
  8.         margin:0 auto;
  9.         width:800px;
  10.         height:200px;
  11. }
  12. .nav .links{
  13.         float:left;
  14.         position:relative;
  15.         width:200px;
  16.         height:200px;
  17.         overflow:hidden;
  18.         -moz-transition:background-color .3s ease-in-out;
  19.         -webkit-transition:background-color .3s ease-in-out;
  20.         -o-transition:background-color .3s ease-in-out;
  21.         -ms-transition:background-color .3s ease-in-out;
  22.         transition:background-color .3s ease-in-out;
  23. }
  24. .nav .links1{background-color:#949494;}
  25. .nav .links2{background-color:#a4a4a4;}
  26. .nav .links3{background-color:#b4b4b4;}
  27. .nav .links4{background-color:#c4c4c4;}
  28. .nav .links .bg{
  29.         position:absolute;
  30.         top:-200px;
  31.         width:200px;
  32.         height:200px;
  33.         opacity:0;
  34.         filter:Alpha(opacity=0);
  35.         background:url(imgs/img_01.png) no-repeat;
  36.         filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='imgs/img_01.png',sizingMethod='crop');
  37.         -moz-transition:top .3s ease-in-out,opacity .5s ease-in-out;
  38.         -webkit-transition:top .3s ease-in-out,opacity .5s ease-in-out;
  39.         -o-transition:top .3s ease-in-out,opacity .5s ease-in-out;
  40.         -ms-transition:top .3s ease-in-out,opacity .5s ease-in-out;
  41.         transition:top .3s ease-in-out,opacity .5s ease-in-out;
  42. }
  43. .nav .links .intro{
  44.         position:absolute;
  45.         left:0;
  46.         top:50%;
  47.         margin-top:-24px;
  48.         width:100%;
  49.         line-height:48px;
  50.         font:48px/1 Tahoma,Impact,Arial;
  51.         color:#fff;
  52.         text-align:center;
  53.         -moz-transition:top .3s ease-in-out,color .3s ease-in-out;
  54.         -webkit-transition:top .3s ease-in-out,color .3s ease-in-out;
  55.         -o-transition:top .3s ease-in-out,color .3s ease-in-out;
  56.         -ms-transition:top .3s ease-in-out,color .3s ease-in-out;
  57.         transition:top .3s ease-in-out,color .3s ease-in-out;
  58. }
  59. .nav .links:hover{background-color:#383838;}
  60. .nav .links:hover .bg{top:-100px;opacity:0.8;filter:Alpha(opacity=80);}
  61. .nav .links:hover .intro{top:70%;color:#f66;}
  62. </style>
  63. </head>
  64. <body>
  65. <div class="nav">
  66.         <a href="#" target="_blank" class="links links1">
  67.             <span class="intro">Index</span>
  68.             <span class="bg"></span>
  69.     </a>
  70.     <a href="#" target="_blank" class="links links2">
  71.             <span class="intro">Article</span>
  72.             <span class="bg"></span>
  73.     </a>
  74.     <a href="#" target="_blank" class="links links3">
  75.             <span class="intro">Photos</span>
  76.             <span class="bg"></span>
  77.     </a>
  78.     <a href="#" target="_blank" class="links links4">
  79.             <span class="intro">Contact</span>
  80.             <span class="bg"></span>
  81.     </a>
  82. </div>
  83. </body>
  84. </html>
复制代码

打赏楼主

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

 
您需要登录后才可以回帖 登录 | 注册

本版积分规则

麦创网 ( 苏ICP备13053101号-1 )

@麦创网 禁止任何未经允许的修改,传播或使用。

Powered by Discuz!

©2012 @ iMac.vip. 用户言论不代表本站立场。

返回顶部