博客列表 >2019年12月20日 作业(CSS)

2019年12月20日 作业(CSS)

L
L原创
2019年12月22日 22:41:50551浏览

预览图


代码

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge" />
  7. <title>导航和轮播图</title>
  8. <link rel="stylesheet" href="static/font/iconfont.css" />
  9. <style>
  10. * {
  11. margin: 0;
  12. padding: 0;
  13. color: #333;
  14. }
  15. a {
  16. text-decoration: none;
  17. }
  18. img {
  19. max-width: 100%;
  20. }
  21. header {
  22. width: 1200px;
  23. margin: auto;
  24. height: 80px;
  25. line-height: 80px;
  26. }
  27. .log {
  28. float: left;
  29. height: 80px;
  30. }
  31. .search {
  32. float: right;
  33. height: 80px;
  34. margin-right: 40px;
  35. }
  36. #search {
  37. width: 300px;
  38. line-height: 30px;
  39. border: 1px solid #ccc;
  40. border-radius: 8px;
  41. padding-left: 8px;
  42. }
  43. #search:hover {
  44. box-shadow: 0 0 5px #666;
  45. }
  46. .search label {
  47. margin-left: -25px;
  48. }
  49. .enter {
  50. float: right;
  51. height: 80px;
  52. }
  53. .enter a {
  54. font-size: 30px;
  55. text-decoration: none;
  56. margin: 5px;
  57. }
  58. .enter a:hover {
  59. color: red;
  60. }
  61. main {
  62. width: 1200px;
  63. margin: auto;
  64. overflow: hidden;
  65. }
  66. .nav {
  67. height: 60px;
  68. line-height: 30px;
  69. }
  70. .bar {
  71. float: left;
  72. width: 300px;
  73. }
  74. .lime {
  75. float: left;
  76. width: 50px;
  77. line-height: 60px;
  78. font-size: 50px;
  79. color: red;
  80. }
  81. .pic {
  82. float: left;
  83. width: 40px;
  84. border-right: 1px solid #ccc;
  85. }
  86. .links {
  87. float: left;
  88. width: 140px;
  89. margin-left: 5px;
  90. }
  91. .focus {
  92. width: 1200px;
  93. margin-top: 30px;
  94. overflow: hidden;
  95. }
  96. .banner {
  97. float: left;
  98. width: 898px;
  99. margin-right: 7px;
  100. }
  101. .side {
  102. float: left;
  103. width: 295px;
  104. }
  105. </style>
  106. </head>
  107. <body>
  108. <header>
  109. <a href="https://www.php.cn" class="log">
  110. <img src="static/images/logo.png" alt="php中文网" />
  111. </a>
  112. <div class="enter">
  113. <a href="" class="icon iconfont icon-huiyuan1"></a>
  114. <a href="" class="icon iconfont icon-danmu1"></a>
  115. <a href="" class="icon iconfont icon-fabu"></a>
  116. <a href="" class="icon iconfont icon-fangda"></a>
  117. <a href="" class="icon iconfont icon-huiyuan2"></a>
  118. <a href="" class="icon iconfont icon-dianzan"></a>
  119. </div>
  120. <div class="search">
  121. <input type="text" id="search" />
  122. <label class="icon iconfont icon-jinduchaxun" for="search">
  123. </label>
  124. </div>
  125. </header>
  126. <main>
  127. <div class="nav">
  128. <div class="bar">
  129. <div class="lime icon iconfont icon-gongdan"></div>
  130. <div class="pic">
  131. <span>资讯</span>
  132. <span>学习</span>
  133. </div>
  134. <div class="links">
  135. <a href="">器材</a>
  136. <a href="">大师</a>
  137. <a href="">学院</a>
  138. <a href="">实战</a>
  139. <a href="">大赛</a>
  140. <a href="">裤子</a>
  141. <a href="">影视</a>
  142. <a href="">其它</a>
  143. </div>
  144. </div>
  145. <div class="bar">
  146. <div class="lime icon iconfont icon-renwujincheng"></div>
  147. <div class="pic">
  148. <span>爱好</span>
  149. <span>姐妹</span>
  150. </div>
  151. <div class="links">
  152. <a href="">有品</a>
  153. <a href="">图片</a>
  154. <a href="">喝水</a>
  155. <a href="">飞机</a>
  156. <a href="">坦克</a>
  157. <a href="">气球</a>
  158. <a href="">毛线</a>
  159. <a href="">其它</a>
  160. </div>
  161. </div>
  162. <div class="bar">
  163. <div class="lime icon iconfont icon-APPkaifa"></div>
  164. <div class="pic">
  165. <span>软件</span>
  166. <span>技能</span>
  167. </div>
  168. <div class="links">
  169. <a href="">学习</a>
  170. <a href="">爱国</a>
  171. <a href="">敬业</a>
  172. <a href="">友善</a>
  173. <a href="">富强</a>
  174. <a href="">互助</a>
  175. <a href="">仁义</a>
  176. <a href="">其它</a>
  177. </div>
  178. </div>
  179. <div class="bar">
  180. <div class="lime icon iconfont icon-xiyiji"></div>
  181. <div class="pic">
  182. <span>编程</span>
  183. <span>美女</span>
  184. </div>
  185. <div class="links">
  186. <a href="">吃饭</a>
  187. <a href="">周易</a>
  188. <a href="">黄山</a>
  189. <a href="">合肥</a>
  190. <a href="">上海</a>
  191. <a href="">杭州</a>
  192. <a href="">北京</a>
  193. <a href="">其它</a>
  194. </div>
  195. </div>
  196. </div>
  197. <div class="focus">
  198. <a href="" class="banner">
  199. <img src="static/images/2.jpg" alt="" />
  200. </a>
  201. <a href="" class="side">
  202. <img src="static/images/banner-right.jpg" alt="" />
  203. </a>
  204. </div>
  205. </main>
  206. </body>
  207. </html>
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议