Blogger Information
Blog 30
fans 0
comment 1
visits 22021
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
前端学习12:20大作业 header部分原生
Admin
Original
788 people have browsed it

源码

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title></title>
  6. <link rel="stylesheet" href="static/font/iconfont.css">
  7. <style type="text/css">
  8. *{
  9. margin: 0;
  10. padding:0;
  11. }
  12. a{
  13. text-decoration: none;
  14. }
  15. li{
  16. list-style: none;
  17. }
  18. header .container{
  19. max-width: 1200px;
  20. margin: 0 auto;
  21. padding: 0 15px;
  22. box-sizing: border-box;
  23. }
  24. .head{
  25. height:79.6px;
  26. line-height: 79.6px;
  27. overflow: hidden;
  28. }
  29. .logo,.searchbox,.shareico{
  30. float: left;
  31. }
  32. .searchbox{
  33. position: relative;
  34. margin: 0px 50px 0px 350px;
  35. }
  36. .searchbox span{
  37. position: absolute;
  38. right: 10px;
  39. }
  40. input[name="search"]{
  41. width: 300px;
  42. height: 30px;
  43. line-height: 30px;
  44. padding:0 5px;
  45. border:1px solid rgba(220, 220, 220);
  46. border-radius: 10px;
  47. }
  48. .shareico .iconfont{
  49. font-size: 36px;
  50. color: rgba(63, 63, 63);
  51. padding: 0 5px;
  52. }
  53. nav ul li{
  54. display: inline-block;
  55. margin-right: 30px;
  56. }
  57. .lefttitle,.cate{
  58. display: inline-block;
  59. font: 16px/32px '微软雅黑';
  60. }
  61. .cate{
  62. border-left:3px solid #efefef;
  63. padding-left:10px;
  64. margin-left: 5px;
  65. }
  66. .lefttitle,.cate a{
  67. color: rgba(112, 112, 112);
  68. }
  69. .lefttitle p,.cate p{
  70. line-height: 25px;
  71. }
  72. .lefttitle .iconfont{
  73. font-size: 45px;
  74. line-height: 53.5px;
  75. color: red;
  76. }
  77. .lefttitle div{
  78. display: inline-block;
  79. }
  80. .banner{
  81. margin-top: 10px;
  82. overflow: hidden;
  83. }
  84. .banner .bigbanner{
  85. width: 65%;
  86. float: left;
  87. }
  88. .banner .smallbanner{
  89. width: 34%;
  90. float: right;
  91. }
  92. .banner img{
  93. width: 100%;
  94. height: 300px;
  95. }
  96. </style>
  97. </head>
  98. <body>
  99. <header>
  100. <div class="container">
  101. <!-- 三大件 -->
  102. <div class="head">
  103. <div class="logo">
  104. <img src="static/images/logo.png" alt="">
  105. </div>
  106. <div class="searchbox">
  107. <form action="">
  108. <input type="text" name="search">
  109. <span class="iconfont icon-sousuo2"></span>
  110. </form>
  111. </div>
  112. <div class="shareico">
  113. <span class="iconfont icon-huiyuan1"></span>
  114. <span class="iconfont icon-danmu1" ></span>
  115. <span class="iconfont icon-fabu" ></span>
  116. <span class="iconfont icon-fangda" ></span>
  117. <span class="iconfont icon-huiyuan2" ></span>
  118. <span class="iconfont icon-dianzan" ></span>
  119. </div>
  120. </div>
  121. <nav>
  122. <ul>
  123. <li>
  124. <div class="lefttitle">
  125. <div>
  126. <span class="iconfont icon-gongdan"></span>
  127. </div>
  128. <div>
  129. <p>资讯</p>
  130. <p>学习</p>
  131. </div>
  132. </div>
  133. <div class="cate">
  134. <p>
  135. <a href="#">器材</a>
  136. <a href="#">大师</a>
  137. <a href="#">学院</a>
  138. <a href="#">实战</a>
  139. </p>
  140. <p>
  141. <a href="#">大赛</a>
  142. <a href="#">裤子</a>
  143. <a href="#">影视</a>
  144. <a href="#">其他</a>
  145. </p>
  146. </div>
  147. </li>
  148. <li>
  149. <div class="lefttitle">
  150. <div>
  151. <span class="iconfont icon-renwujincheng"></span>
  152. </div>
  153. <div>
  154. <p>爱好</p>
  155. <p>姐妹</p>
  156. </div>
  157. </div>
  158. <div class="cate">
  159. <p>
  160. <a href="#">有品</a>
  161. <a href="#">图片</a>
  162. <a href="#">喝水</a>
  163. <a href="#">飞机</a>
  164. </p>
  165. <p>
  166. <a href="#">坦克</a>
  167. <a href="#">气球</a>
  168. <a href="#">毛线</a>
  169. <a href="#">其他</a>
  170. </p>
  171. </div>
  172. </li>
  173. <li>
  174. <div class="lefttitle">
  175. <div>
  176. <span class="iconfont icon-gongdan"></span>
  177. </div>
  178. <div>
  179. <p>软件</p>
  180. <p>技能</p>
  181. </div>
  182. </div>
  183. <div class="cate">
  184. <p>
  185. <a href="#">学习</a>
  186. <a href="#">爱国</a>
  187. <a href="#">敬业</a>
  188. <a href="#">友善</a>
  189. </p>
  190. <p>
  191. <a href="#">富强</a>
  192. <a href="#">互助</a>
  193. <a href="#">仁义</a>
  194. <a href="#">其他</a>
  195. </p>
  196. </div>
  197. </li>
  198. <li>
  199. <div class="lefttitle">
  200. <div>
  201. <span class="iconfont icon-DOC"></span>
  202. </div>
  203. <div>
  204. <p>编程</p>
  205. <p>美女</p>
  206. </div>
  207. </div>
  208. <div class="cate">
  209. <p>
  210. <a href="#">吃饭</a>
  211. <a href="#">周易</a>
  212. <a href="#">黄山</a>
  213. <a href="#">合肥</a>
  214. </p>
  215. <p>
  216. <a href="#">上海</a>
  217. <a href="#">杭州</a>
  218. <a href="#">北京</a>
  219. <a href="#">其他</a>
  220. </p>
  221. </div>
  222. </li>
  223. </ul>
  224. </nav>
  225. <div class="banner">
  226. <div class="bigbanner">
  227. <img src="static/images/2.jpg">
  228. </div>
  229. <div class="smallbanner">
  230. <img src="static/images/banner-right.jpg">
  231. </div>
  232. </div>
  233. </div>
  234. </header>
  235. </body>
  236. </html>

当我看到这个大作业的时候我是觉得很简单的,flex布局可以刷刷的搞定,后来老师说要用原生浮动和定位!当然也是简单,但是其中的导航部分我花了一部分时间,写了三种方法….发现都好麻烦,于是乎还是好好加标签。
还有一个最无奈的地方就是….命名真的不知道要起什么名字!最后希望老师在下发的素材中有更多像右边小姐姐这么好看的图!

Correcting teacher:天蓬老师天蓬老师

Correction status:qualified

Teacher's comments:你应该单身吧, 这么喜欢看小姐姐... 传统布局现在工作中用得不多了, 但还是有必要掌握的
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post