精選WPHTML+CSS代碼舉例

HTML+CSS代碼:

  1. <!doctype html>  
  2. <html lang="en">  
  3. <head>  
  4.     <meta charset="UTF-8">  
  5.     <title>Arrow by CoolWP.com</title>  
  6.     <style>  
  7. html{font-size:62.5%;}   
  8. body{   
  9.     width:90%;   
  10.     position: relative;   
  11.     margin:0;   
  12.     margin-left:5%;   
  13.     margin-top:100px;   
  14.     padding:0;   
  15.     color:#fff;   
  16.     background-color: #D2D057;   
  17.     font-size:16px;   
  18.     font-size:1.6rem;   
  19. }   
  20. div{   
  21.     display: block;   
  22.     color: #005480;   
  23. }   
  24. @font-face {   
  25.     font-family: 'ChristopherhandRegular';   
  26.     src: url('font/comesinhandy-webfont.eot');   
  27.     src: url('font/comesinhandy-webfont.eot?#iefix') format('embedded-opentype'),   
  28.          url('font/comesinhandy-webfont.woff') format('woff'),   
  29.          url('font/comesinhandy-webfont.ttf') format('truetype'),   
  30.          url('font/comesinhandy-webfont.svg#ChristopherhandRegular') format('svg');   
  31.     font-weight: normal;   
  32.     font-style: normal;   
  33. }   
  34.   
  35. h2{  
  36.    font-size:30px; 
  37.     font-size: 3rem;   
  38.     line-height: 0.8;   
  39.     color: #333;   
  40.     font-family: 'ChristopherhandRegular', Arial, Helvetica, sans-serif;   
  41.     font-weight: normal;   
  42. }   
  43.   
  44.   
  45. .box {   
  46.     background-color: #F8F299;   
  47.     border: 10px solid #fff;   
  48.     padding: 15px 20px 5px 20px;   
  49.     margin: 0 0 30px 0;   
  50.     box-shadow: 0 0 5px rgba(0, 0, 0, .3);   
  51.     -webkit-box-shadow: 5px 10px 3px #333;   
  52.     -moz-box-shadow: 5px 10px 3px #333;   
  53.     box-shadow: 5px 10px 3px #333;   
  54. }   
  55.   
  56. .arrow {   
  57.     display: block;   
  58.     width: 100px;   
  59.     height: 100px;   
  60.     background: url(img/arrows-sprite.png ) no-repeat 0 0 transparent;   
  61.     position: absolute;   
  62. }   
  63. .arrow.arrow-1 {   
  64.     background-position: 0 0;   
  65. }   
  66. .arrow.arrow-2 {   
  67.     background-position: 0 -100px;   
  68. }   
  69. .arrow.arrow-3 {   
  70.     background-position: 0 -203px;   
  71.     width: 43px;   
  72.     height: 52px;   
  73. }   
  74. .arrow.arrow-4 {   
  75.     background-position: -50px -200px;   
  76.     width: 50px;   
  77.     height: 60px;   
  78. }   
  79. .arrow.arrow-5 {   
  80.     background-position: 0 -304px;   
  81.     width: 81px;   
  82.     height: 72px;   
  83. }   
  84. .arrow.arrow-6 {   
  85.     background-position: 0 -400px;   
  86.     width: 50px;   
  87.     height: 60px;   
  88. }   
  89. .arrow.arrow-7 {   
  90.     background-position: -50px -400px;   
  91.     width: 45px;   
  92.     height: 60px;   
  93. }   
  94. .arrow.arrow-8 {   
  95.     background-position: 0 -464px;   
  96.     width: 30px;   
  97.     height: 38px;   
  98. }   
  99. .box  {   
  100.     width: 20%;   
  101.     float: left;   
  102.     margin-left:5%;   
  103.     min-height:450px;   
  104.   
  105. }   
  106. .clearer {   
  107.     float: none;   
  108.     clear: both;   
  109. }   
  110. span{line-height:60px;}   
  111. </style>  
  112. </head>  
  113. <body>  
  114.     <div>  
  115.         <h2 style="">Arrows by CoolWP.com</h2>  
  116.     </div>  
  117.     <div class="box">  
  118.         <span class="arrow arrow-1 "></span>  
  119.             <h2 style="padding-top:60px">Arrow 1</h2>  
  120.         <span class="arrow arrow-2"></span>  
  121.             <h2 style="padding-top:90px">Arrow 2</h2>  
  122.         <span class="arrow arrow-3"></span>  
  123.             <h2 style="padding-top:60px">Arrow 3</h2>  
  124.     </div>  
  125.   
  126.     <div class="box  boxright">  
  127.         <span class="arrow arrow-4"></span>  
  128.             <h2 style="padding-top:60px">Arrow 4</h2>  
  129.   
  130.         <span class="arrow arrow-5"></span>  
  131.             <h2 style="padding-top:90px">Arrow 5</h2>  
  132.   
  133.     </div>  
  134.     <div class="box  boxright">  
  135.         <span class="arrow arrow-6"></span>  
  136.             <h2 style="padding-top:60px">Arrow 6</h2>  
  137.   
  138.         <span class="arrow arrow-7"></span>  
  139.             <h2 style="padding-top:60px">Arrow 7</h2>  
  140.         <span class="arrow arrow-8"></span>  
  141.             <h2 style="padding-top:40px">Arrow 8</h2>  
  142.     </div>  
  143. <div class="clearer"></div>  
  144. </body>  
  145. </html>  
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章