博客列表 >12月21日到22日作业 用传统HTML+CSS, 完成一个首页头部的布局-PHP培训十期线上班

12月21日到22日作业 用传统HTML+CSS, 完成一个首页头部的布局-PHP培训十期线上班

洋
原创
2019年12月30日 01:33:47413浏览

最近事情比较多,作业是跟着老师的视频打的,等有时间了在尝试自己独立完成
代码段:

  1. <!DOCTYPE html>
  2. <html lang='en'>
  3. <head>
  4. <meta charset = "UTF-8">
  5. <link rel = "stylesheet" href = "font/iconfont.css">
  6. <title>12月20号作业</title>
  7. <style>
  8. *{ /*初始化所有元素的内外边距,字体大小*/
  9. margin : 0px;
  10. padding : 0px;
  11. font-size : 13px;
  12. /*outline : 1px dashed red;*/
  13. }
  14. a{
  15. color : #555555;
  16. font-size : 13px;
  17. text-decoration : none;
  18. }
  19. .index-header {
  20. width : 1200px;
  21. min-height : 300px;
  22. margin : 30px auto;
  23. }
  24. .index-header > .top {
  25. height : 70px;
  26. position : relative;
  27. line-height : 70px;
  28. /*background-color : yellow;*/
  29. }
  30. .index-header > .top *{
  31. height : inherit;
  32. /*line-height : 70px;*/
  33. }
  34. .index-header > .top > .logo {
  35. width : 176px;
  36. position : absolute;
  37. top : 0;
  38. left : 0;
  39. }
  40. .index-header > .top > .search {
  41. width : 330px;
  42. position : absolute;
  43. top : 0;
  44. right : 350px;
  45. }
  46. .index-header > .top > .quick-start {
  47. width : 300px;
  48. position : absolute;
  49. top : 0;
  50. right : 0;
  51. }
  52. .index-header > .top > .logo img {
  53. height : 100%;
  54. display : block;
  55. }
  56. .index-header > .top > .search > input[type="search"] {
  57. width : 330px;
  58. height : 36px;
  59. border-radius : 10px;
  60. padding : 10px;
  61. }
  62. .index-header > .top > .search > input[type="search"]:hover {
  63. box-shadow : 0 0 5px #888888;
  64. }
  65. .index-header > .top > .search > input[type="search"] + label {
  66. font-size : 23px;
  67. margin-left : -30px;
  68. position : relative;
  69. top : 5px;
  70. }
  71. .index-header > .top > .quick-start > span {
  72. font-size : 33px;
  73. margin-right : 6px;
  74. }
  75. .index-header > .top > .quick-start > span:hover {
  76. color : red;
  77. cursor : pointer;
  78. }
  79. .index-header > .nav {
  80. height : 44px;
  81. /*background-color : red;*/
  82. }
  83. .index-header > .nav > .nav-item {
  84. width : 300px;
  85. height : inherit;
  86. position : relative;
  87. float : left;
  88. }
  89. .index-header > .nav > .nav-item > .iconfont {
  90. font-size : 40px;
  91. color : red;
  92. position : absolute;
  93. }
  94. .index-header > .nav > .nav-item > .tag {
  95. width : 40px;
  96. position : absolute;
  97. left : 45px;
  98. border-right : 1px solid #cccccc;
  99. }
  100. .index-header > .nav > .nav-item > .links {
  101. width : 160px;
  102. position : absolute;
  103. left : 95px;
  104. }
  105. .index-header > .nav > .nav-item > .links > a:hover{
  106. color : red;
  107. }
  108. .index-header > .slider-ads {
  109. height : 320px;
  110. position : relative;
  111. }
  112. .index-header > .slider-ads > .slider {
  113. width : 900px;
  114. position : absolute;
  115. }
  116. .index-header > .slider-ads > .ads {
  117. width : 295px;
  118. position : absolute;
  119. right : 0;
  120. }
  121. .index-header > .slider-ads img {
  122. height : 100%;
  123. display : block;
  124. }
  125. .index-header * {
  126. margin : 10px 0px;
  127. }
  128. </style>
  129. </head>
  130. <body>
  131. <div class="index-header"> <!-- 页面整体容器开始 -->
  132. <div class="top"> <!-- 页面上部容器开始 -->
  133. <div class="logo"> <!-- 页面上部logo图标开始 -->
  134. <a href=""><img src="static/images/logo.png" alt = ""></a>
  135. </div> <!-- 页面上部logo图标结束 -->
  136. <div class="search"> <!-- 页面上部搜索开始 -->
  137. <input type="search" id="search"><label for = "search" class = "iconfont icon-search"></label>
  138. </div> <!-- 页面上部搜索结束 -->
  139. <div class = "quick-start"> <!-- 页面上部小图标开始 -->
  140. <span class="iconfont icon-tongxunlu"></span>
  141. <span class="iconfont icon-liaotian"></span>
  142. <span class="iconfont icon-shangchuan"></span>
  143. <span class="iconfont icon-fangda"></span>
  144. <span class="iconfont icon-wode"></span>
  145. <span class="iconfont icon-dianzan"></span>
  146. </div> <!-- 页面上部小图标结束 -->
  147. </div> <!-- 页面上部容器结束 -->
  148. <div class="nav"> <!-- 中部导航容器开始 -->
  149. <div class="nav-item"> <!-- 中部导航子模块开始 -->
  150. <span class="iconfont icon-liebiaodaohang_dongman"></span> <!-- 导航图标 -->
  151. <div class="tag"> <!-- 导航名称 -->
  152. <span>资讯</span>
  153. <span>学习</span>
  154. </div>
  155. <div class="links"> <!-- 导航链接 -->
  156. <a href="">器材</a>
  157. <a href="">大师</a>
  158. <a href="">学院</a>
  159. <a href="">实战</a>
  160. <a href="">大赛</a>
  161. <a href="">裤子</a>
  162. <a href="">影视</a>
  163. <a href="">其他</a>
  164. </div>
  165. </div> <!-- 中部导航子模块结束 -->
  166. <div class="nav-item"> <!-- 中部导航子模块开始 -->
  167. <span class="iconfont icon-liebiaodaohang_dongman"></span> <!-- 导航图标 -->
  168. <div class="tag"> <!-- 导航名称 -->
  169. <span>资讯</span>
  170. <span>学习</span>
  171. </div>
  172. <div class="links"> <!-- 导航链接 -->
  173. <a href="">器材</a>
  174. <a href="">大师</a>
  175. <a href="">学院</a>
  176. <a href="">实战</a>
  177. <a href="">大赛</a>
  178. <a href="">裤子</a>
  179. <a href="">影视</a>
  180. <a href="">其他</a>
  181. </div>
  182. </div> <!-- 中部导航子模块结束 -->
  183. <div class="nav-item"> <!-- 中部导航子模块开始 -->
  184. <span class="iconfont icon-liebiaodaohang_dongman"></span> <!-- 导航图标 -->
  185. <div class="tag"> <!-- 导航名称 -->
  186. <span>资讯</span>
  187. <span>学习</span>
  188. </div>
  189. <div class="links"> <!-- 导航链接 -->
  190. <a href="">器材</a>
  191. <a href="">大师</a>
  192. <a href="">学院</a>
  193. <a href="">实战</a>
  194. <a href="">大赛</a>
  195. <a href="">裤子</a>
  196. <a href="">影视</a>
  197. <a href="">其他</a>
  198. </div>
  199. </div> <!-- 中部导航子模块结束 -->
  200. <div class="nav-item"> <!-- 中部导航子模块开始 -->
  201. <span class="iconfont icon-liebiaodaohang_dongman"></span> <!-- 导航图标 -->
  202. <div class="tag"> <!-- 导航名称 -->
  203. <span>资讯</span>
  204. <span>学习</span>
  205. </div>
  206. <div class="links"> <!-- 导航链接 -->
  207. <a href="">器材</a>
  208. <a href="">大师</a>
  209. <a href="">学院</a>
  210. <a href="">实战</a>
  211. <a href="">大赛</a>
  212. <a href="">裤子</a>
  213. <a href="">影视</a>
  214. <a href="">其他</a>
  215. </div>
  216. </div> <!-- 中部导航子模块结束 -->
  217. </div> <!-- 中部导航容器结束 -->
  218. <div class="slider-ads"> <!-- 底部图片区域 -->
  219. <div class="slider">
  220. <a href=""><img src="static/images/2.jpg" alt="aa"></a>
  221. </div>
  222. <div class="ads">
  223. <a href=""><img src="static/images/banner-right.jpg" alt=""></a>
  224. </div>
  225. </div>
  226. </div> <!-- 页面整体容器结束 -->
  227. </body>
  228. </html>

效果图:

声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议