Blogger Information
Blog 62
fans 3
comment 1
visits 29691
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
仿php中文网首页
kiraseo_wwwkiraercom
Original
307 people have browsed it

仿php中文网首页

代码如下

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <link rel="stylesheet" href="css/zuoye.css">
  8. <title>Document</title>
  9. </head>
  10. <body>
  11. <header>
  12. <div class="top">
  13. <div class="content">
  14. <div class="title">php中文网,程序员梦开始的地方!</div>
  15. <div class="right">
  16. <a href="" class="iconfont icon-tixingtianchong"></a>
  17. <a href=""><img src="images/user-pic.jpeg" alt="" ></a>
  18. </div>
  19. </div>
  20. </div>
  21. <div class="navs">
  22. <div class="content">
  23. <a href=""><img src="images/logo.png"></a>
  24. <nav>
  25. <a class="active" href="">首页</a>
  26. <a href="">视频教程</a>
  27. <a href="">学习路径</a>
  28. <a href="">php培训</a>
  29. <a href="">资源下载</a>
  30. </nav>
  31. <div class="search">
  32. <input type="search" placeholder="输入关键字" >
  33. <span class="iconfont icon-fangdajing1"></span>
  34. </div>
  35. </div>
  36. </div>
  37. </header>
  38. <main>
  39. <div class="navs">
  40. <div class="left">
  41. <a href="">视频教程</a>
  42. <a href="">学习路径</a>
  43. <a href="">PHP培训</a>
  44. <a href="">资源下载</a>
  45. <a href="">技术文章</a>
  46. <a href="">PHP培训</a>
  47. <a href="">资源下载</a>
  48. <a href="">技术文章</a>
  49. </div>
  50. <div class="slider">
  51. <img src="images/course.jpg">
  52. </div>
  53. <div class="right">
  54. <div class="main">
  55. <div class="user">
  56. <a href=""> <img src="images/user-pic.jpeg"></a>
  57. <div class="user-main">
  58. <a href="" class="user-name">kiraseo</a>
  59. <span>P豆 48.5</span>
  60. </div>
  61. </div>
  62. </div>
  63. <div class="study">
  64. <input type="button" value="我的学习">
  65. </div>
  66. <div class="list">
  67. <p><span>问答社区</span><a class="tag" href="">答疑</a></p>
  68. <p><span>头条</span><a href="">【吐血整理】2022年最新前端面试题大全及答案(收藏)</a></p>
  69. <p><span>公告</span><a href="">课程合作计划</a></p>
  70. <p><span>公告</span><a href="">课程合作计划</a></p>
  71. <p><span>公告</span><a href="">课程合作计划</a></p>
  72. <p><span>公告</span><a href="">课程合作计划</a></p>
  73. </div>
  74. </div>
  75. <div class="bottom-left">
  76. <div class="desc">
  77. <div class="title">学习路径</div>
  78. <span>全部7个&gt;</span>
  79. </div>
  80. <ul class="detail">
  81. <li onclick="">
  82. <img src="images/dgjj.png" alt="" />
  83. <a href="">独孤九贱</a>
  84. <span>9门课程</span>
  85. </li>
  86. <li onclick="">
  87. <img src="images/ynxj.png" alt="" />
  88. <a href="">独孤九贱</a>
  89. <span>9门课程</span>
  90. </li>
  91. <li onclick="">
  92. <img src="images/tlbb.png" alt="" />
  93. <a href="">独孤九贱</a>
  94. <span>9门课程</span>
  95. </li>
  96. <li onclick="">
  97. <img src="images/phpkjkf.png" alt="" />
  98. <a href="">独孤九贱</a>
  99. <span>9门课程</span>
  100. </li>
  101. <li onclick="">
  102. <img src="images/phpksrm.png" alt="" />
  103. <a href="">独孤九贱</a>
  104. <span>9门课程</span>
  105. </li>
  106. </ul>
  107. </div>
  108. <div class="bottom-right">
  109. <a href=""><img src="images/tlbb.png" alt=""><span>课程</span></a>
  110. <a href=""><img src="images/tlbb.png" alt=""><span>课程</span></a>
  111. </div>
  112. </div>
  113. </main>
  114. </body>
  115. </html>

css代码如下

  1. @import url("https://at.alicdn.com/t/font_3205780_7eqow85axa.css");
  2. *{margin: 0; padding: 0; box-sizing: border-box;}
  3. a{text-decoration: none; color: #333;}
  4. li{list-style: none;}
  5. body{
  6. background-color: #f3f5f7;
  7. }
  8. header .top{
  9. width: 100vw;
  10. }
  11. header .top{
  12. height: 40px;
  13. background-color: #343434;
  14. color: #aaa;
  15. }
  16. header .top .content,
  17. header .navs .content,
  18. main .navs{
  19. width: 1200px;
  20. margin: auto;
  21. }
  22. header .top .content{
  23. display: grid;
  24. grid-template-columns: 400px 100px;
  25. place-content: space-between ;
  26. place-items: center start;
  27. }
  28. header .top .content .right{
  29. display: grid;
  30. grid-template-columns: 30px 60px;
  31. place-content: space-between ;
  32. place-items: center start;
  33. }
  34. header .top .content .right .iconfont{
  35. color: #eee;
  36. font-size: larger;
  37. }
  38. header .top .content img{
  39. width: 50%;
  40. border-radius: 50%;
  41. }
  42. header .navs{
  43. height: 90px;
  44. }
  45. header .navs .content{
  46. display: grid;
  47. grid-template-columns: 140px 1fr 200px;
  48. place-content: space-between ;
  49. place-items: center start;
  50. }
  51. header .navs .content img{
  52. width: 140px;
  53. }
  54. header .navs .content nav{
  55. display: flex;
  56. padding: 0 1em;
  57. place-content: space-between ;
  58. place-items: center start;
  59. }
  60. header .navs .content nav a{
  61. margin-left: 24px;
  62. font-size: larger;
  63. font-weight: lighter;
  64. }
  65. header .navs .content nav a.active,
  66. header .navs .content nav a:hover,
  67. main .navs .left a:hover,
  68. header .navs .content .search .iconfont:hover{
  69. color: red;
  70. }
  71. header .navs .content .search{
  72. display: grid;
  73. grid-template-columns: 200px 1fr;
  74. place-content: space-between ;
  75. place-items: center start;
  76. }
  77. header .navs .content .search input[type='search']{
  78. border: none;
  79. outline: none;
  80. background-color: #e9e9e9;
  81. padding-left: 10px;
  82. border-radius: 25px;
  83. height: 40px;
  84. }
  85. header .navs .content .search .iconfont{
  86. position: relative;
  87. left: -50px;
  88. }
  89. main{
  90. font-size: 14px;
  91. }
  92. main .navs{
  93. display: grid;
  94. grid-template-columns:160px 810px 200px;
  95. grid-template-rows: 400px 80px;
  96. gap:20px;
  97. }
  98. main .navs > * {
  99. background-color: #fff;
  100. border-radius: 20px;
  101. }
  102. main .navs .left{
  103. display: flex;
  104. flex-direction: column;
  105. place-content: space-between;
  106. }
  107. main .navs .left a{
  108. width: 126px;
  109. margin: auto;
  110. font-size: larger;
  111. font-weight: lighter;
  112. text-align: center;
  113. }
  114. main .navs .slider img{
  115. width: 100%;
  116. height: 100%;
  117. }
  118. main .navs .right .main{
  119. padding: 1em;
  120. }
  121. main .navs .right .main .user{
  122. display: grid;
  123. grid-template-columns:20px 80px;
  124. place-content: center;
  125. place-items: flex-end;
  126. }
  127. main .navs .right .main .user img{
  128. border-radius:50% ;
  129. width: 40px;
  130. }
  131. main .navs .right .main .user .user-main{
  132. font-size: 15px;
  133. margin-left: 18px;
  134. place-content: center;
  135. place-self: start;
  136. }
  137. main .navs .right .main .user .user-main .user-name{
  138. font-size: larger;
  139. font-weight: bolder;
  140. }
  141. main .navs .right .study{
  142. padding: 1em 1em 2em 1em;
  143. }
  144. main .navs .right .study input[type='button']{
  145. width: 92%;
  146. height: 34px;
  147. border: none;
  148. outline: none;
  149. border-radius: 25px;
  150. background-color: red;
  151. color: #fff;
  152. }
  153. main .navs .right .list{
  154. padding-top: 7px;
  155. display: flex;
  156. flex-direction: column;
  157. place-content: space-between;
  158. margin: auto;
  159. height: 250px;
  160. }
  161. /*问答社区*/
  162. main .navs .right .list p{
  163. display: grid;
  164. grid-template-columns: 1fr 130px;
  165. place-content: center;
  166. place-self: self-start;
  167. }
  168. main .navs .right .list p span{
  169. font-size: larger;
  170. font-weight:lighter;
  171. color: #333;
  172. place-items:start;
  173. place-self: baseline;
  174. margin-right: 17px;
  175. width: 100%;
  176. }
  177. body main .navs .right .list p .tag{
  178. background-color: #ff583d;
  179. color: #fff;
  180. margin-left: 10px;
  181. }
  182. main .navs .right .list p a{
  183. place-items:end;
  184. place-content: center;
  185. place-self: start;
  186. }
  187. main .navs .right .list p a:hover{
  188. color: red;
  189. }
  190. main .navs .bottom-left {
  191. grid-column: span 2;
  192. display: grid;
  193. grid-template-columns:100px 1fr;
  194. }
  195. main .navs .bottom-left .desc {
  196. padding: 16px 0;
  197. display: grid;
  198. place-items: center;
  199. }
  200. main .navs .bottom-left .desc span {
  201. font-size: 12px;
  202. color: #999;
  203. }
  204. main .navs .bottom-left .detail{
  205. display: flex;
  206. place-items: center;
  207. place-content: space-between;
  208. padding: 20px;
  209. }
  210. main .navs .bottom-left .detail >li{
  211. display: grid;
  212. grid-template-columns:36px 85px;
  213. height: 36px;
  214. }
  215. main .navs .bottom-left .detail>li>img{
  216. width: 100%;
  217. grid-row: span 2;
  218. }
  219. main .navs .bottom-left .detail a,
  220. main .navs .bottom-left .detail span{
  221. margin-left: 10px;
  222. }
  223. main .navs .bottom-left .detail a{
  224. font-size: 14px;
  225. }
  226. main .navs .bottom-left .detail span{
  227. font-size: 12px;
  228. color: #999;
  229. }
  230. main .navs .bottom-right{
  231. display: flex;
  232. flex-direction: row;
  233. place-content: space-between;
  234. }
  235. main .navs .bottom-right a{
  236. display: grid;
  237. place-content: center;
  238. place-items: center;
  239. place-self: baseline;
  240. }
  241. main .navs .bottom-right img{
  242. width: 40%;
  243. border-radius: 50%;
  244. }

最终效果图

Correcting teacher:PHPzPHPz

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