Blogger Information
Blog 6
fans 1
comment 0
visits 5723
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
前端简单页面
xiaosheng
Original
1388 people have browsed it

前端简单基础页面

  • 效果如下
  • 代码如下:

    本篇着重于实现效果,不讨论代码的质量
    字体图标选自阿里矢量图

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Homework</title>
  6. <link rel="stylesheet" href="./font_1575331_l1xjfvqanw/iconfont.css">
  7. <style>
  8. @font-face {
  9. font-family: 'iconfont';
  10. src: url('iconfont.eot');
  11. src: url('iconfont.eot?#iefix') format('embedded-opentype'),
  12. url('iconfont.woff2') format('woff2'),
  13. url('iconfont.woff') format('woff'),
  14. url('iconfont.ttf') format('truetype'),
  15. url('iconfont.svg#iconfont') format('svg');
  16. }
  17. .iconfont {
  18. font-family: "iconfont" !important;
  19. font-size: 16px;
  20. font-style: normal;
  21. -webkit-font-smoothing: antialiased;
  22. -moz-osx-font-smoothing: grayscale;
  23. }
  24. * {
  25. padding: 0;
  26. margin: 0;
  27. }
  28. a {
  29. text-decoration: none;
  30. color: #414141;
  31. }
  32. .all {
  33. width: 1200px;
  34. height: 1000px;
  35. /*background-color: #abcdef;*/
  36. margin: 0 auto;
  37. }
  38. .logo {
  39. width: 312px;
  40. height: 65px;
  41. float: left;
  42. }
  43. .search {
  44. float: left;
  45. margin-left: 300px;
  46. width: 300px;
  47. height: 65px;
  48. line-height: 65px;
  49. margin-top: 10px;
  50. position: relative;
  51. }
  52. .search span{
  53. display: inline-block;
  54. width: 300px;
  55. height: 45px;
  56. vertical-align: middle;
  57. border: 1px solid gray;
  58. -webkit-border-radius: 13px;
  59. -moz-border-radius: 13px;
  60. border-radius: 13px;
  61. }
  62. .search i{
  63. position: absolute;
  64. font-size: 25px;
  65. right: 15px;
  66. top: 0px;
  67. }
  68. .option {
  69. float: right;
  70. width: 250px;
  71. height: 65px;
  72. line-height: 65px;
  73. margin-top: 10px;
  74. text-align: left;
  75. }
  76. .option i {
  77. font-size: 30px;
  78. margin-right: 10px;
  79. }
  80. .option i.last {
  81. margin-right: 0;
  82. }
  83. .nav {
  84. height: 75px;
  85. float: left;
  86. overflow: hidden;
  87. position: relative;
  88. /*background-color: blue;*/
  89. }
  90. .nav .nav1 {
  91. margin-left: 0;
  92. }
  93. .nav1,.nav2,.nav3,.nav4 {
  94. width: 250px;
  95. margin-top: 15px;
  96. margin-left: 65px;
  97. /*line-height: 75px;*/
  98. float: left;
  99. }
  100. .nav1 span {
  101. float: left;
  102. }
  103. .nav1 i {
  104. font-size: 45px;
  105. color: #ff2017;
  106. }
  107. .nav1 table {
  108. float: left;
  109. margin-left: 15px;
  110. }
  111. .nav1 tr {
  112. height: 21px;
  113. color: #404040;
  114. }
  115. .nav1 td {
  116. padding-left: 7px;
  117. }
  118. .nav1 td:first-of-type {
  119. padding-right: 15px;
  120. }
  121. .nav2 span{
  122. float: left;
  123. }
  124. .nav2 i {
  125. font-size: 45px;
  126. color: #ff2017;
  127. }
  128. .nav2 table {
  129. float: left;
  130. margin-left: 15px;
  131. }
  132. .nav2 tr{
  133. height: 21px;
  134. color: #404040;
  135. }
  136. .nav2 td {
  137. padding-left: 7px;
  138. }
  139. .nav2 td:first-of-type {
  140. padding-right: 15px;
  141. }
  142. .nav3 span{
  143. float: left;
  144. }
  145. .nav3 i {
  146. font-size: 45px;
  147. color: #ff2017;
  148. }
  149. .nav3 table {
  150. float: left;
  151. margin-left: 15px;
  152. }
  153. .nav3 tr{
  154. height: 21px;
  155. color: #404040;
  156. }
  157. .nav3 td {
  158. padding-left: 7px;
  159. }
  160. .nav3 td:first-of-type {
  161. padding-right: 15px;
  162. }
  163. .nav4 span{
  164. float: left;
  165. }
  166. .nav4 i {
  167. font-size: 45px;
  168. color: #ff2017;
  169. }
  170. .nav4 table {
  171. float: left;
  172. margin-left: 15px;
  173. }
  174. .nav4 tr{
  175. height: 21px;
  176. color: #404040;
  177. }
  178. .nav4 td {
  179. padding-left: 7px;
  180. }
  181. .nav4 td:first-of-type {
  182. padding-right: 15px;
  183. }
  184. .img {
  185. overflow: hidden;
  186. width: 1200px;
  187. margin-top: 150px;
  188. }
  189. .line1,.line2,.line3,.line4{
  190. position: absolute;
  191. float: left;
  192. width: 0;
  193. height: 44px;
  194. top: 16px;
  195. border: 1px solid #cccccc;
  196. }
  197. .line1 {
  198. left: 103px;
  199. }
  200. .line2 {
  201. left: 418px;
  202. }
  203. .line3 {
  204. left: 732px;
  205. }
  206. .line4 {
  207. left: 1048px;
  208. }
  209. </style>
  210. </head>
  211. <body>
  212. <div class="all">
  213. <header class="header">
  214. <div class="logo">
  215. <img src="images/logo.png" alt="">
  216. </div>
  217. <div class="search">
  218. <span></span>
  219. <i class="iconfont">&#xe66a;</i>
  220. </div>
  221. <div class="option">
  222. <a href=""><i class="iconfont">&#xe63d;</i></a>
  223. <a href=""><i class="iconfont">&#xe626;</i></a>
  224. <a href=""><i class="iconfont">&#xe620;</i></a>
  225. <a href=""><i class="iconfont">&#xec32;</i></a>
  226. <a href=""><i class="iconfont">&#xe610;</i></a>
  227. <a href=""><i class="iconfont last">&#xe680;</i></a>
  228. </div>
  229. </header>
  230. <div class="nav">
  231. <div class="nav1">
  232. <span><i class="iconfont">&#xe60d;</i></span>
  233. <table>
  234. <tr>
  235. <td><a href="">资讯</a></td>
  236. <td><a href="">器材</a></td>
  237. <td><a href="">大师</a></td>
  238. <td><a href="">学院</a></td>
  239. <td><a href="">实战</a></td>
  240. </tr>
  241. <tr>
  242. <td><a href="">资讯</a></td>
  243. <td><a href="">器材</a></td>
  244. <td><a href="">大师</a></td>
  245. <td><a href="">学院</a></td>
  246. <td><a href="">实战</a></td>
  247. </tr>
  248. </table>
  249. </div>
  250. <div class="line1"></div>
  251. <div class="nav2">
  252. <span><i class="iconfont">&#xe627;</i></span>
  253. <table>
  254. <tr>
  255. <td><a href="">资讯</a></td>
  256. <td><a href="">器材</a></td>
  257. <td><a href="">大师</a></td>
  258. <td><a href="">学院</a></td>
  259. <td><a href="">实战</a></td>
  260. </tr>
  261. <tr>
  262. <td><a href="">资讯</a></td>
  263. <td><a href="">器材</a></td>
  264. <td><a href="">大师</a></td>
  265. <td><a href="">学院</a></td>
  266. <td><a href="">实战</a></td>
  267. </tr>
  268. </table>
  269. </div>
  270. <div class="line2"></div>
  271. <div class="nav3">
  272. <span><i class="iconfont">&#xe617;</i></span>
  273. <table>
  274. <tr>
  275. <td><a href="">资讯</a></td>
  276. <td><a href="">器材</a></td>
  277. <td><a href="">大师</a></td>
  278. <td><a href="">学院</a></td>
  279. <td><a href="">实战</a></td>
  280. </tr>
  281. <tr>
  282. <td><a href="">资讯</a></td>
  283. <td><a href="">器材</a></td>
  284. <td><a href="">大师</a></td>
  285. <td><a href="">学院</a></td>
  286. <td><a href="">实战</a></td>
  287. </tr>
  288. </table>
  289. </div>
  290. <div class="line3"></div>
  291. <div class="nav4">
  292. <span><i class="iconfont">&#xe611;</i></span>
  293. <table>
  294. <tr>
  295. <td><a href="">资讯</a></td>
  296. <td><a href="">器材</a></td>
  297. <td><a href="">大师</a></td>
  298. <td><a href="">学院</a></td>
  299. <td><a href="">实战</a></td>
  300. </tr>
  301. <tr>
  302. <td><a href="">资讯</a></td>
  303. <td><a href="">器材</a></td>
  304. <td><a href="">大师</a></td>
  305. <td><a href="">学院</a></td>
  306. <td><a href="">实战</a></td>
  307. </tr>
  308. </table>
  309. </div>
  310. <div class="line4"></div>
  311. </div>
  312. <div class="img">
  313. <img src="./images/2.jpg" alt="">
  314. <img src="./images/banner-right.jpg" alt="">
  315. </div>
  316. </div>
  317. </body>
  318. </html>
Correcting teacher:天蓬老师天蓬老师

Correction status:qualified

Teacher's comments:建议将字体图片的具体值写到class中, 不要写到标签内容区, 否则会影响到搜索引擎抓取
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