博客列表 >仿PHP中文网首页部分

仿PHP中文网首页部分

Time
Time原创
2022年03月27日 21:31:04608浏览

图片展示

index1
index2

代码

HTML 代码部分

  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. <title>仿php.cn</title>
  8. <link rel="stylesheet" href="static/css/reset.css">
  9. <link rel="stylesheet" href="//at.alicdn.com/t/font_3280335_t3u4plz9cur.css">
  10. <!-- <link rel="stylesheet" href="static/iconfont/iconfont.css"> -->
  11. <link rel="stylesheet" href="static/css/header.css">
  12. <link rel="stylesheet" href="static/css/main.css">
  13. </head>
  14. <body>
  15. <!-- 页眉 -->
  16. <header>
  17. <!-- 顶部 -->
  18. <div class="top">
  19. <div class="content">
  20. <div class="title">php程序员梦开始的地方</div>
  21. <div class="right">
  22. <a href="" class="iconfont icon-lingdang"></a>
  23. <a href=""><img src="static/images/user-pic.jpeg" alt=""></a>
  24. </div>
  25. </div>
  26. </div>
  27. <!-- 导航 -->
  28. <div class="navs">
  29. <div class="content">
  30. <a href="" class="log"><img src="static/images/logo.png" alt=""></a>
  31. <nav>
  32. <a href="" class="active">首页</a>
  33. <a href="">视频教程</a>
  34. <a href="">学习路径</a>
  35. <a href="">php培训</a>
  36. <a href="">资源下载</a>
  37. <a href="">技术文章</a>
  38. <a href="">社区</a>
  39. </nav>
  40. <div class="search">
  41. <input type="search" placeholder="输入关键字搜索">
  42. <span class="iconfont icon-fangdajing fdj"></span>
  43. </div>
  44. </div>
  45. </div>
  46. </header>
  47. <!-- 主体 -->
  48. <main>
  49. <div class="navs">
  50. <div class="left">
  51. <a href="">php开发</a>
  52. <a href="">大前端</a>
  53. <a href="">后端开发</a>
  54. <a href="">数据库</a>
  55. <a href="">移动端</a>
  56. <a href="">运维开发</a>
  57. <a href="">UI设计</a>
  58. <a href="">计算机基础</a>
  59. </div>
  60. <div class="slider">
  61. <a href=""><img src="static/images/slider.jpeg" alt=""></a>
  62. </div>
  63. <div class="right">
  64. <div class="right-content">
  65. <div class="right-content-shang">
  66. <div class="right-content-shang1"> <span>
  67. <a href=""><img src="static/images/user-pic.jpeg" alt=""></a>
  68. </span>
  69. <dl>
  70. <dt><a href="">Time</a></dt>
  71. <dd>p豆 12</dd>
  72. </dl>
  73. </div>
  74. <div class="right-content-shang2">
  75. <a href="">我的学习</a>
  76. </div>
  77. </div>
  78. <div class="right-content-xia">
  79. <div class="f1">
  80. <span>问答社区</span>
  81. <a href="" >答疑</a>
  82. </div>
  83. <div class="f2">
  84. <p>
  85. <span>头条</span>
  86. <a href="">程序员有多好</a>
  87. <!-- <marquee direction="up" style="float: right;">UP</marquee> -->
  88. </p>
  89. <p>
  90. <span>新课</span>
  91. <a href="">3.9号公益直播课</a>
  92. </p>
  93. <p>
  94. <span>新班</span>
  95. <a href="">19期PHP直播班</a>
  96. </p>
  97. <p>
  98. <span>招募</span>
  99. <a href="">课程合作计划</a>
  100. </p>
  101. <p>
  102. <span>公告</span>
  103. <a href="">APP上线啦</a>
  104. </p>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. <div class="bottom-left">
  110. <!-- 学习路径 -->
  111. <div class="desc">
  112. <div class="title">学习路径</div>
  113. <span>全部7个&gt</span>
  114. </div>
  115. <ul class="detail">
  116. &lt
  117. <li onclick="">
  118. <img src="static/images/dgjj.png" alt="">
  119. <a href="">独孤九剑</a>
  120. <span>9门课程</span>
  121. </li>
  122. <li onclick="">
  123. <img src="static/images/ynxj.png" alt="">
  124. <a href="">玉女心经</a>
  125. <span>5门课程</span>
  126. </li>
  127. <li onclick="">
  128. <img src="static/images/tlbb.png" alt="">
  129. <a href="">天龙八部</a>
  130. <span>3门课程</span>
  131. </li>
  132. <li onclick="">
  133. <img src="static/images/phpkjkf.png" alt="">
  134. <a href="">自学指南</a>
  135. <span>19门课程</span>
  136. </li>
  137. <li onclick="">
  138. <img src="static/images/phpksrm.png" alt="">
  139. <a href="">趣味闯关</a>
  140. <span>22门课程</span>
  141. </li>
  142. </ul>
  143. </div>
  144. <div class="bottom-right">
  145. <ul class="content">
  146. <li>
  147. <a href="">
  148. <b class="iconfont icon-logo-wechat"></b>
  149. <h2>官方公众号</h2>
  150. </a>
  151. </li>
  152. <li>
  153. <a href="">
  154. <b class="iconfont icon-QQ-circle-fill"></b>
  155. <h2>官方QQ群</h2>
  156. </a>
  157. </li>
  158. </ul>
  159. </div>
  160. </div>
  161. <div class="plate">
  162. <div class="content">
  163. <div class="title">
  164. <h2>最新课程</h2>
  165. <a href="">更多&gt</a>
  166. </div>
  167. <ul class="list">
  168. <li>
  169. <span>
  170. <a href=""><img src="static/images/list1.jpg" alt=""></a>
  171. </span>
  172. <dl>
  173. <dt><i>初级</i><a href="">JavaScript基础语法【dom|bom|es6新语</a></dt>
  174. <dd><p>318次学习</p><a href=""><b class="iconfont icon-shoucang"></b>收藏</a></dd>
  175. </dl>
  176. </li>
  177. <li>
  178. <span>
  179. <a href=""><img src="static/images/list1.jpg" alt=""></a>
  180. </span>
  181. <dl>
  182. <dt><i>初级</i><a href="">JavaScript基础语法【dom|bom|es6新语</a></dt>
  183. <dd><p>318次学习</p><a href=""><b class="iconfont icon-shoucang"></b>收藏</a></dd>
  184. </dl>
  185. </li>
  186. <li>
  187. <span>
  188. <a href=""><img src="static/images/list1.jpg" alt=""></a>
  189. </span>
  190. <dl>
  191. <dt><i>初级</i><a href="">JavaScript基础语法【dom|bom|es6新语</a></dt>
  192. <dd><p>318次学习</p><a href=""><b class="iconfont icon-shoucang"></b>收藏</a></dd>
  193. </dl>
  194. </li>
  195. <li>
  196. <span>
  197. <a href=""><img src="static/images/list1.jpg" alt=""></a>
  198. </span>
  199. <dl>
  200. <dt><i>初级</i><a href="">JavaScript基础语法【dom|bom|es6新语</a></dt>
  201. <dd><p>318次学习</p><a href=""><b class="iconfont icon-shoucang"></b>收藏</a></dd>
  202. </dl>
  203. </li>
  204. <li>
  205. <span>
  206. <a href=""><img src="static/images/list1.jpg" alt=""></a>
  207. </span>
  208. <dl>
  209. <dt><i>初级</i><a href="">JavaScript基础语法【dom|bom|es6新语</a></dt>
  210. <dd><p>318次学习</p><a href=""><b class="iconfont icon-shoucang"></b>收藏</a></dd>
  211. </dl>
  212. </li>
  213. <li>
  214. <span>
  215. <a href=""><img src="static/images/list1.jpg" alt=""></a>
  216. </span>
  217. <dl>
  218. <dt><i>初级</i><a href="">JavaScript基础语法【dom|bom|es6新语</a></dt>
  219. <dd><p>318次学习</p><a href=""><b class="iconfont icon-shoucang"></b>收藏</a></dd>
  220. </dl>
  221. </li>
  222. <li>
  223. <span>
  224. <a href=""><img src="static/images/list1.jpg" alt=""></a>
  225. </span>
  226. <dl>
  227. <dt><i>初级</i><a href="">JavaScript基础语法【dom|bom|es6新语</a></dt>
  228. <dd><p>318次学习</p><a href=""><b class="iconfont icon-shoucang"></b>收藏</a></dd>
  229. </dl>
  230. </li>
  231. <li>
  232. <span>
  233. <a href=""><img src="static/images/list1.jpg" alt=""></a>
  234. </span>
  235. <dl>
  236. <dt><i>初级</i><a href="">JavaScript基础语法【dom|bom|es6新语</a></dt>
  237. <dd><p>318次学习</p><a href=""><b class="iconfont icon-shoucang"></b>收藏</a></dd>
  238. </dl>
  239. </li>
  240. <li>
  241. <span>
  242. <a href=""><img src="static/images/list1.jpg" alt=""></a>
  243. </span>
  244. <dl>
  245. <dt><i>初级</i><a href="">JavaScript基础语法【dom|bom|es6新语</a></dt>
  246. <dd><p>318次学习</p><a href=""><b class="iconfont icon-shoucang"></b>收藏</a></dd>
  247. </dl>
  248. </li>
  249. <li>
  250. <span>
  251. <a href=""><img src="static/images/list1.jpg" alt=""></a>
  252. </span>
  253. <dl>
  254. <dt><i>初级</i><a href="">JavaScript基础语法【dom|bom|es6新语</a></dt>
  255. <dd><p>318次学习</p><a href=""><b class="iconfont icon-shoucang"></b>收藏</a></dd>
  256. </dl>
  257. </li>
  258. </ul>
  259. </div>
  260. </div>
  261. </main>
  262. </body>
  263. </html>

css代码

header.css

  1. header .top{
  2. width: 100vw;
  3. height: 40px;
  4. background-color: rgb(52, 52, 52);
  5. color: #aaa;
  6. }
  7. header .top .content img{
  8. width: 50%;
  9. border-radius: 50%;
  10. }
  11. header .top .content {
  12. display: grid;
  13. width: 1200px;
  14. grid-template-columns: 400px 100px;
  15. place-content: space-between;
  16. margin: auto;
  17. grid-auto-rows: 40px;
  18. place-items: center start;
  19. }
  20. header .top .content .right .iconfont{
  21. font-size: 18px;
  22. color: #eee;
  23. }
  24. header .top .content .right{
  25. display: grid;
  26. grid-template-columns: repeat(2,1fr);
  27. place-items: center;
  28. }
  29. /* 导航 */
  30. header .navs{
  31. width: 100vw;
  32. height: 90px;
  33. background-color: #fff;
  34. }
  35. header .navs .content{
  36. display: grid;
  37. width: 1200px;
  38. grid-template-columns: 140px 1fr 200px;
  39. grid-auto-rows: 90px;
  40. margin: auto;
  41. gap: 10px;
  42. place-items: center start;
  43. }
  44. header .navs .content img{
  45. width: 90%;
  46. }
  47. header .navs .content a.active,
  48. header .navs .content a:hover{
  49. color: red;
  50. font-weight: bold;
  51. }
  52. header .navs .content .search{
  53. display: flex;
  54. }
  55. header .navs .content nav a{
  56. padding: 0 18px;
  57. }
  58. header .navs .content .search input[type="search"]{
  59. width: 200px;
  60. height: 36px;
  61. border: none;
  62. outline: none;
  63. background-color: #f7f8fa;
  64. border-radius: 100px;
  65. padding-left: 10px;
  66. }
  67. header .navs .content .search .fdj{
  68. font-size: 22px;
  69. color: #ccc;
  70. position: relative;
  71. left: -48px;
  72. top: 5px;
  73. }

main.css

  1. main{
  2. font-size: 14px;
  3. }
  4. main .navs{
  5. display: grid;
  6. grid-template-columns: 160px 810px 190px;
  7. grid-template-rows: 400px 80px;
  8. gap: 20px;
  9. place-content: center;
  10. margin: 30px 0;
  11. }
  12. main .navs>*{
  13. background-color: #fff;
  14. border-radius: 20px;
  15. }
  16. /* 底部左侧两列 */
  17. main .navs .bottom-left{
  18. grid-column: span 2;
  19. }
  20. main .navs .slider img{
  21. width: 100%;
  22. border-radius: 20px;
  23. }
  24. main .navs .left{
  25. display: grid;
  26. place-items: center;
  27. padding: 20px 0;
  28. }
  29. main .navs .left a:hover{
  30. color: red;
  31. background-color: rgb(250, 223, 227);
  32. }
  33. main .navs .left a{
  34. padding: 10px 20px;
  35. border-radius: 20px;
  36. }
  37. main .navs .bottom-left{
  38. display: grid;
  39. grid-template-columns: 100px 1fr;
  40. }
  41. main .navs .bottom-left .desc{
  42. display: grid;
  43. place-items: center;
  44. padding: 16px;
  45. }
  46. main .navs .bottom-left .detail img{
  47. grid-row: span 2;
  48. width: 100%;
  49. }
  50. main .navs .bottom-left .detail {
  51. display: flex;
  52. place-items: center;
  53. place-content: space-between;
  54. }
  55. main .navs .bottom-left .detail li{
  56. display: grid;
  57. grid-template-columns: 36px 85px;
  58. gap: 0 10px;
  59. place-items: center start;
  60. }
  61. main .navs .bottom-left .detail li a {
  62. font-size: 14px;
  63. }
  64. main .navs .bottom-left .detail li span,
  65. main .navs .bottom-left .desc span{
  66. font-size: 12px;
  67. color: #999;
  68. }
  69. main .navs .bottom-left .detail li a:hover {
  70. color: red;
  71. }
  72. main .navs .right .right-content{
  73. display: grid;
  74. grid-template-rows: 142px 240px;
  75. }
  76. main .navs .right .right-content .right-content-shang{
  77. display: grid;
  78. border-bottom: 1px solid #eeeeee;
  79. padding: 0 0 20px 0;
  80. }
  81. main .navs .right .right-content .right-content-shang .right-content-shang1{
  82. margin: auto;
  83. }
  84. main .navs .right .right-content .right-content-shang .right-content-shang1 img{
  85. float: left;
  86. width: 40px;
  87. height: 40px;
  88. border-radius: 100px;
  89. margin-top: 20px;
  90. }
  91. main .navs .right .right-content .right-content-shang .right-content-shang1 dl{
  92. float: right;
  93. width: 105px;
  94. margin-top: 15px;
  95. padding: 0 10px;
  96. }
  97. main .navs .right .right-content .right-content-shang .right-content-shang1 dd{
  98. color: #b6b6b6;
  99. }
  100. main .navs .right .right-content .right-content-shang .right-content-shang1 a{
  101. font-weight: bold;
  102. }
  103. main .navs .right .right-content .right-content-shang .right-content-shang2{
  104. width: 150px;
  105. height: 34px;
  106. background: #f11717;
  107. border-radius: 100px;
  108. line-height: 34px;
  109. text-align: center;
  110. text-decoration: none;
  111. overflow: hidden;
  112. margin-top: 20px;
  113. margin-left: 20px;
  114. }
  115. main .navs .right .right-content .right-content-shang .right-content-shang2 a {
  116. color: #ffffff;
  117. }
  118. main .navs .right .right-content .right-content-xia{
  119. display: grid;
  120. grid-template-rows: 50px 1fr;
  121. margin-left: 20px;
  122. }
  123. main .navs .right .right-content .right-content-xia .f1 a{
  124. width: 31px;
  125. height: 16px;
  126. background: #ff583d;
  127. border-radius: 2px;
  128. font-size: 12px;
  129. color: #ffffff;
  130. line-height: 16px;
  131. }
  132. main .navs .right .right-content .right-content-xia .f2 a:hover{
  133. color: red;
  134. }
  135. main .navs .right .right-content .right-content-xia .f1{
  136. place-self: center start;
  137. }
  138. main .navs .right .right-content .right-content-xia .f1 span{
  139. margin-right: 10px;
  140. }
  141. main .navs .right .right-content .right-content-xia .f1 a{
  142. padding: 1px 3px;
  143. }
  144. main .navs .right .right-content .right-content-xia .f2{
  145. display: grid;
  146. place-items: center start;
  147. }
  148. main .navs .right .right-content .right-content-xia .f2 a{
  149. color: #b6b6b6;
  150. }
  151. main .navs .bottom-right .content{
  152. display: grid;
  153. grid-template-columns: repeat(2,1fr);
  154. place-items: center;
  155. place-content: space-between;
  156. }
  157. main .navs .bottom-right .content li a h2{
  158. font-size: 12px;
  159. font-weight: bold;
  160. height: 16px;
  161. line-height: 16px;
  162. overflow: hidden;
  163. margin-top: 5px;
  164. }
  165. main .navs .bottom-right .content li a b{
  166. font-size: 30px;
  167. margin-left: 13px;
  168. }
  169. main .navs .bottom-right .content li {
  170. float: left;
  171. width: 70px;
  172. margin-top: 13px;
  173. margin-left: 20px;
  174. }
  175. main .navs .right .right-content .right-content-xia .f2 p span{
  176. padding: 0 10px 0 0;
  177. }
  178. main .plate{
  179. width: 1200px;
  180. margin: 30px 0;
  181. margin: auto;
  182. }
  183. main .plate .content{
  184. display: grid;
  185. grid-template-rows: 32px 530px;
  186. }
  187. main .plate .content .title{
  188. display: grid;
  189. grid-template-columns: 88px 78px;
  190. grid-template-rows: 32px;
  191. place-content: space-between;
  192. place-items: center start;
  193. }
  194. main .plate .content .title a{
  195. padding: 10px 10px;
  196. width: 78px;
  197. height: 32px;
  198. background: #f0f1f4;
  199. color: #999999;
  200. border-radius: 20px;
  201. text-align: center;
  202. }
  203. main .plate .content .list{
  204. display: grid;
  205. grid-template-columns: repeat(5,1fr);
  206. grid-template-rows: repeat(2,1fr);
  207. place-content: space-between;
  208. gap: 10px;
  209. margin-top: 30px;
  210. }
  211. main .plate .content .list li img{
  212. width: 100%;
  213. border-radius: 6px 6px 0px 0px;
  214. }
  215. main .plate .content .list li{
  216. display: grid;
  217. }
  218. main .plate .content .list li dl dt{
  219. margin-left: 10px;
  220. }
  221. main .plate .content .list li dl dt i{
  222. float: left;
  223. width: 28px;
  224. height: 16px;
  225. background: #93999f;
  226. line-height: 16px;
  227. overflow: hidden;
  228. text-align: center;
  229. font-style: normal;
  230. font-size: 11px;
  231. color: #ffffff;
  232. margin-right: 10px;
  233. margin-top: 3px;
  234. }
  235. main .plate .content .list li dl dd{
  236. display: flex;
  237. margin-top: 15px;
  238. place-content: space-between;
  239. color: #b7b7b7;
  240. }
  241. main .plate .content .list li dl dd a {
  242. color: #b7b7b7;
  243. }
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议