当前位置:Gxlcms > css > 使用CSS3实现超酷的黑猫警长首页

使用CSS3实现超酷的黑猫警长首页

时间:2021-07-01 10:21:17 帮助过:51人阅读

这篇文章主要为大家介绍了CSS3实现超酷的黑猫警长首页的相关代码,效果酷炫,具有一定的参考价值,感兴趣的小伙伴们可以参考一下

先看看效果图:

具体代码:

  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>text-shadow</title>
  5. <style type="text/css">
  6. body {/*清除页边距,设计主色调*/
  7. padding: 0px;
  8. margin: 0px;
  9. color: #666;
  10. }
  11. #text-shadow-box {/*设计盒子外框样式*/
  12. position: relative;/*让内部的定位元素以这个框为参照物*/
  13. width: 598px;
  14. height: 406px;
  15. background: #666;
  16. overflow: hidden;/*禁止内容超过设定的区域*/
  17. border: #333 1px solid;
  18. }
  19. #text-shadow-box p.wall {/*设置背景墙样式*/
  20. position: absolute;
  21. width: 100%;
  22. top: 175px;
  23. left: 0px
  24. }
  25. #text {/*设计导航文本样式*/
  26. text-align: center;
  27. line-height: 0.5em;
  28. margin: 0px;
  29. font-family: helvetica, arial, sans-serif;
  30. height: 1px;
  31. color: #999;
  32. font-size: 80px;
  33. font-weight: bold;
  34. text-shadow: 5px -5px 16px #000;/*设计右上偏移的阴影,适当进行模糊处理,产生色晕效果,阴影色为深色,营造静谧的效果*/
  35. }
  36. p.wall p {/*设计前面挡风板样式*/
  37. position: absolute;
  38. width: 100%;
  39. height: 300px;
  40. top: 42px;
  41. left: 0px;
  42. background: #999;
  43. }
  44. #spotlight {/*设计覆盖在上面的探照灯效果图*/
  45. position: absolute;/*设计一个层,让其覆盖在页面上,并使其满窗口显示,通过前期设计好的一个探照灯背景来营造神秘效果*/
  46. width: 100%;
  47. height: 100%;
  48. top: 0px;
  49. left: 0px;
  50. background: url(images/spotlight.png) center -300px;
  51. }
  52. #spotlight a {
  53. color:#ccc;
  54. text-decoration:none;
  55. position:absolute;
  56. left:47%;
  57. top:56%;
  58. float:left;
  59. }
  60. a img { border:none; }
  61. </style>
  62. </head>
  63. <body>
  64. <!--本案例的结构外套-->
  65. <p id="text-shadow-box">
  66. <!--墙体外结构-->
  67. <p class="wall">
  68. <p id="text">黑猫警长</p>
  69. <p></p>
  70. </p>
  71. <!--外罩,通过他可以为页面覆盖一层桌纸,添加特殊的艺术效果-->
  72. <p id="spotlight"><a href="index.htm"><img src="images/cat1.png" /></a></p>
  73. </p>
  74. </body>
  75. </html>

以上就是本文的全部内容,希望对大家的学习有所帮助,更多相关内容请关注PHP中文网!

相关推荐:

CSS3实现预载动画效果的几种方法

关于css实现六边形图片的方法

以上就是使用CSS3实现超酷的黑猫警长首页的详细内容,更多请关注Gxl网其它相关文章!

人气教程排行