博客列表 >仿php中文网演练

仿php中文网演练

Blackeye
Blackeye原创
2022年03月28日 14:52:33429浏览

show1

  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中文网</title>
  8. <link rel="stylesheet" href="static/css/reset.css">
  9. <link rel="stylesheet" href="static/css/hw.css">
  10. </head>
  11. <body>
  12. <!-- 头部 -->
  13. <div class="top">
  14. <div class="content">
  15. <div class="top-left top-left-icon"></div>
  16. <div class="top-right">
  17. <div class="top-right-icon"></div>
  18. <img src="static/image/user.jpeg" alt="user img">
  19. </div>
  20. </div>
  21. </div>
  22. <!-- 导航栏 -->
  23. <div class="nav">
  24. <div class="content">
  25. <div class="logo"></div>
  26. <div class="nav-list">
  27. <nav>
  28. <a href="">首页</a>
  29. <a href="">视频教程</a>
  30. <a href="">学习路径</a>
  31. <a href="">php培训</a>
  32. <a href="">资源下载</a>
  33. <a href="">技术文章</a>
  34. <a href="">社区</a>
  35. </nav>
  36. </div>
  37. <div class="search">
  38. <input type="text" placeholder="输入关键词搜索">
  39. <input type="submit" class="inputSearch">
  40. </div>
  41. </div>
  42. </div>
  43. <!-- 主体 -->
  44. <main>
  45. <div class="first-row">
  46. <div class="mainContent">
  47. <!-- 1 -->
  48. <div class="class-list">
  49. <a href="">php开发</a>
  50. <a href="">大前端</a>
  51. <a href="">后端开发</a>
  52. <a href="">数据库</a>
  53. <a href="">移动端</a>
  54. <a href="">运维开发</a>
  55. <a href="">UI设计</a>
  56. <a href="">计算机基础</a>
  57. </div>
  58. <!-- 2 -->
  59. <div class="banner">
  60. <a href="">
  61. <img src="static/image/slider.jpeg" alt="" />
  62. </a>
  63. </div>
  64. <!-- 3 -->
  65. <div class="notice">
  66. <div class="noticeTop">
  67. <div class="userinfo">
  68. <div class="userinfo-left">
  69. <img src="static/image/user.jpeg" alt="">
  70. </div>
  71. <div class="userinfo-right">
  72. <div>Blackeye</div>
  73. <div>P豆 &nbsp; 9999</div>
  74. </div>
  75. </div>
  76. <div class="myinfo">
  77. <button>我的学习</button>
  78. </div>
  79. </div>
  80. <div class="noticeButtom">
  81. <div><span>问答社区</span><a href="#" class="notice-first">答疑</a></div>
  82. <div>
  83. <span>头条</span>
  84. <div class="roll">
  85. <div class="animation">
  86. <a href="/toutiao-490267.html" target="_blank">“程序员做饭指南”,GitHub热榜第一!</a>
  87. <a href="/toutiao-490161.html" target="_blank">首个采用中文编写的操作系统出现了!</a>
  88. <a href="/toutiao-489943.html" target="_blank">Web3现状如何?能否在政策助推下复刻互联网辉煌?</a>
  89. <a href="/toutiao-489887.html" target="_blank">JetBrains和Gitlab均表明暂停在俄罗斯的业务,国内网友对此有何看法?</a>
  90. <a href="/toutiao-489859.html" target="_blank">美国Figma封停大疆等被制裁中国公司账号,国内就没替代了?</a>
  91. <a href="/toutiao-489822.html" target="_blank">程序员有多好?阿姨懂!</a>
  92. </div>
  93. </div>
  94. </div>
  95. <div><span>新课</span><a href="" class="asite">3.9号公益直播课</a></div>
  96. <div><span>新班</span><a href="" class="asite">19期PHP直播班</a></div>
  97. <div><span>招募</span><a href="" class="asite">课程合作计划</a></div>
  98. <div><span>公告</span><a href="" class="asite">APP上线啦</a></div>
  99. </div>
  100. </div>
  101. <!-- 4 -->
  102. <div class="pathWay">
  103. <div class="pathWay-left">
  104. <div>学习路径</div>
  105. <div>全部7个&gt;</div>
  106. </div>
  107. <div class="pathWay-right">
  108. <div><a href=""><img src="static/image/dgjj.png" alt=""><span>独孤九剑<br><p>9门课程</p></span></a></div>
  109. <div><a href=""><img src="static/image/dgjj.png" alt=""><span>独孤九剑<br><p>9门课程</p></span></a></div>
  110. <div><a href=""><img src="static/image/dgjj.png" alt=""><span>独孤九剑<br><p>9门课程</p></span></a></div>
  111. <div><a href=""><img src="static/image/dgjj.png" alt=""><span>独孤九剑<br><p>9门课程</p></span></a></div>
  112. <div><a href=""><img src="static/image/dgjj.png" alt=""><span>独孤九剑<br><p>9门课程</p></span></a></div>
  113. </div>
  114. </div>
  115. <!-- 5 -->
  116. <div class="social">
  117. <div class="WX-div">
  118. <div class="WX"></div>
  119. <a href="">官方公众号</a>
  120. </div>
  121. <div class="QQ-div">
  122. <div class="QQ"></div>
  123. <a href="">官方QQ群</a>
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. <div class="mainContent"></div>
  129. <div class="mainContent"></div>
  130. <div class="mainContent"></div>
  131. <div class="mainContent"></div>
  132. </main>
  133. </body>
  134. </html>
  1. /* 统一居中样式 */
  2. .content {
  3. width: 1200px;
  4. display: grid;
  5. margin: auto;
  6. }
  7. /* 顶部细节 */
  8. .top {
  9. width: 100vw;
  10. background-color: #343434;
  11. }
  12. /* 顶部grid样式 */
  13. .top .content {
  14. height: 40px;
  15. grid-template-columns: 230px 75px;
  16. grid-auto-flow: 40px;
  17. place-content: space-between;
  18. }
  19. /* 顶部左侧精灵图 */
  20. .top-left-icon {
  21. width: 230px;
  22. height: 16px;
  23. background: url(../image/sprite.png) no-repeat 0px 0px;
  24. margin: 13px 0px 0px 0px;
  25. }
  26. /* 顶部右边子grid */
  27. .top-right {
  28. display: grid;
  29. grid-template-columns: 15px 30px;
  30. place-content: space-between;
  31. }
  32. /* 顶部右侧精灵图 */
  33. .top-right-icon {
  34. width: 13px;
  35. height: 14px;
  36. background: url(../image/sprite.png) no-repeat 0px -105px;
  37. margin: 17px 0px 0px 0px;
  38. }
  39. /* 顶部image位置 */
  40. .top-right img {
  41. width: 25px;
  42. height: 25px;
  43. border-radius: 50%;
  44. margin-top: 7px;
  45. border: 1px solid #343434;
  46. margin-left: 30px;
  47. }
  48. /* 设置导航条默认属性 */
  49. .nav {
  50. width: 100vw;
  51. background-color: #fff;
  52. }
  53. /* 设置导航条grid样式 */
  54. .nav .content {
  55. height: 90px;
  56. grid-template-columns: 140px 825px 200px;
  57. grid-auto-flow: 90px;
  58. place-content: center;
  59. gap: 0px 40px;
  60. }
  61. /* php中文网logo */
  62. .nav .content .logo {
  63. place-items: center;
  64. width: 140px;
  65. height: 34px;
  66. background: url(../image/logo.png) no-repeat;
  67. }
  68. /* 设置导航条位置 */
  69. .nav .content .nav-list nav {
  70. margin-top: 13px;
  71. }
  72. /* 设置导航条文字大小 */
  73. .nav .content .nav-list nav a {
  74. margin-right: 10px;
  75. font-size: 16px;
  76. /* font-weight: bold; */
  77. }
  78. /* 设置导航条文字间距及字号 */
  79. .nav .content .nav-list nav a {
  80. padding: 5px;
  81. margin-right: 10px;
  82. font-size: 16px;
  83. /* font-weight: bold; */
  84. }
  85. /* 设置首页和悬浮效果 */
  86. .nav .content .nav-list nav a:first-of-type,
  87. .nav .content .nav-list nav a:hover {
  88. font-weight: bold;
  89. color: red;
  90. }
  91. /* 设置搜索框位置 */
  92. .nav .content .search {
  93. margin-top: 10px;
  94. }
  95. /* 设置搜索框大小 */
  96. .nav .content .search input {
  97. width: 175px;
  98. height: 36px;
  99. border: none;
  100. outline: none;
  101. border-radius: 20px;
  102. background-color: #f7f8fa;
  103. color: #999;
  104. font-size: 12px;
  105. padding-left: 20px;
  106. }
  107. /* 设置搜索图标 */
  108. .nav .content .search .inputSearch {
  109. width: 17px;
  110. height: 17px;
  111. border: none;
  112. background: url(../image/sprite.png) no-repeat -45px -25px;
  113. position: relative;
  114. left: -40px;
  115. }
  116. /* 设置搜索图标悬浮样式 */
  117. .nav .content .search .inputSearch:hover {
  118. cursor: pointer;
  119. background: url(../image/sprite.png) no-repeat -70px -25px;
  120. }
  121. /* 设置主题框字号 */
  122. main {
  123. font-size: 14px;
  124. }
  125. /* 设置主内容区grid */
  126. main .first-row .mainContent {
  127. display: grid;
  128. grid-template-columns: 160px 810px 190px;
  129. grid-template-rows: 400px 80px;
  130. gap: 20px;
  131. place-content: center;
  132. margin: 30px 0;
  133. }
  134. /* 设置填充背景 */
  135. main .first-row > .mainContent > * {
  136. background-color: #fff;
  137. border-radius: 20px;
  138. }
  139. /* 设置左侧导航栏grid */
  140. main .first-row .mainContent .class-list {
  141. display: grid;
  142. place-items: center;
  143. padding: 20px 0;
  144. }
  145. /* 设置左侧导航栏内边距 */
  146. main .first-row .mainContent .class-list a {
  147. padding: 10px 20px;
  148. border-radius: 20px;
  149. }
  150. /* 设置左侧导航栏悬浮状态 */
  151. main .first-row .mainContent .class-list a:hover {
  152. color: red;
  153. background-color: rgb(250, 223, 227);
  154. }
  155. /* 设置图片圆角 */
  156. main .first-row .mainContent .banner img {
  157. border-radius: 20px;
  158. }
  159. /* 设置左下跨行 */
  160. main .first-row .mainContent .pathWay {
  161. grid-column: 1 / span 2;
  162. }
  163. /* 设置右下grid */
  164. main .first-row .mainContent .social {
  165. display: grid;
  166. grid-template-columns: 60px 60px;
  167. place-content: space-around;
  168. font-size: 12px;
  169. font-weight: bold;
  170. }
  171. /* 设置微信图标 */
  172. main .first-row .mainContent .social .WX {
  173. width: 30px;
  174. height: 30px;
  175. background: url(../image/sprite.png) no-repeat -40px -60px;
  176. margin: auto;
  177. }
  178. /* 设置QQ图标 */
  179. main .first-row .mainContent .social .QQ {
  180. width: 30px;
  181. height: 30px;
  182. background: url(../image/sprite.png) no-repeat 0px -60px;
  183. margin: auto;
  184. }
  185. /* 设置悬浮鼠标状态 */
  186. main .first-row .mainContent .social div:hover {
  187. cursor: pointer;
  188. }
  189. /* 设置右下悬浮状态 */
  190. main .first-row .mainContent .social .WX-div > a:hover,
  191. main .first-row .mainContent .social .QQ-div > a:hover {
  192. color: red;
  193. }
  194. /* 右侧gird布局 */
  195. main .first-row .mainContent .notice {
  196. display: grid;
  197. grid-template-rows: 140px 240px;
  198. place-content: space-around;
  199. /* grid-auto-flow: column; */
  200. }
  201. /* 右侧上半段grid布局 */
  202. main .first-row .mainContent .notice .noticeTop {
  203. display: grid;
  204. grid-template-rows: 60px 34px;
  205. }
  206. /* 右侧上半段边界 */
  207. .notice .noticeTop {
  208. border-bottom: 1px solid #eee;
  209. }
  210. .notice .noticeTop .userinfo {
  211. display: grid;
  212. grid-template-columns: 40px 44px;
  213. }
  214. .notice .noticeTop .userinfo .userinfo-left img {
  215. width: 40px;
  216. height: 40px;
  217. border-radius: 100px;
  218. margin-top: 20px;
  219. }
  220. .notice .noticeTop .userinfo .userinfo-right {
  221. margin-left: 20px;
  222. width: 105px;
  223. }
  224. .notice .noticeTop .userinfo .userinfo-right div:first-of-type {
  225. margin: 20px 0 0 0;
  226. font-weight: bold;
  227. }
  228. .notice .noticeTop .userinfo .userinfo-right div:first-of-type:hover {
  229. cursor: pointer;
  230. color: red;
  231. }
  232. .notice .noticeTop .userinfo .userinfo-right div:last-of-type {
  233. height: 16px;
  234. overflow: hidden;
  235. font-size: 12px;
  236. color: #999;
  237. margin-top: 8px;
  238. }
  239. .notice .noticeTop .myinfo button {
  240. width: 150px;
  241. height: 34px;
  242. background: #f11717;
  243. border-radius: 100px;
  244. color: white;
  245. margin-top: 20px;
  246. outline: none;
  247. border: none;
  248. }
  249. .notice .noticeTop .myinfo button:hover{
  250. cursor: pointer;
  251. background-color: rgb(255,31,31,0.75);
  252. }
  253. main .first-row .mainContent .notice .noticeButtom {
  254. display: grid;
  255. grid-template-rows: 18px 41px 18px 18px 18px 18px;
  256. padding: 10px 0;
  257. place-content: space-evenly;
  258. }
  259. main .first-row .mainContent .notice .noticeButtom div span {
  260. color: #333;
  261. }
  262. /* 右侧答疑 */
  263. .notice .noticeButtom .notice-first {
  264. display: inline-block;
  265. width: 31px;
  266. height: 16px;
  267. background: #ff583d;
  268. border-radius: 2px;
  269. font-size: 12px;
  270. color: #fff;
  271. line-height: 16px;
  272. text-align: center;
  273. margin-left: 20px;
  274. }
  275. /* 轮播图初始化 */
  276. .notice .noticeButtom .roll {
  277. width: 100px;
  278. height: 41px;
  279. margin-left: 50px;
  280. overflow: hidden;
  281. position: relative;
  282. margin-top: -20px;
  283. }
  284. /* 右侧a标签 */
  285. .notice .noticeButtom .roll a {
  286. color: #b6b6b6;
  287. }
  288. /* 右侧a标签 */
  289. .notice .noticeButtom .asite {
  290. color: #b6b6b6;
  291. margin-left: 20px;
  292. }
  293. /* 轮播图 */
  294. @keyframes anis {
  295. 100% {
  296. transform: translateY(-200px);
  297. }
  298. }
  299. img {
  300. position: absolute;
  301. }
  302. .animation {
  303. animation: anis 10s linear infinite;
  304. }
  305. .animation:hover {
  306. animation-play-state: paused;
  307. }
  308. .pathWay{
  309. display: grid;
  310. grid-template-columns: 100px 870px;
  311. }
  312. .pathWay{
  313. gap: 20px;
  314. }
  315. .pathWay-left{
  316. place-self: center;
  317. }
  318. .pathWay-left div:last-of-type{
  319. font-size: 12px;
  320. color: #999;
  321. margin-top: 5px;
  322. }
  323. .pathWay-right{
  324. display: grid;
  325. grid-template-columns: repeat(5, 1fr);
  326. margin-top: 20px;
  327. }
  328. .pathWay-right img{
  329. width: 36px;
  330. height: 36px;
  331. border-radius: 2px;
  332. }
  333. .pathWay-right span{
  334. margin-left: 45px;
  335. }
  336. .pathWay-right span>*{
  337. margin-left: 45px;
  338. }
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议