博客列表 >仿PHP中文网移动端

仿PHP中文网移动端

phpcn_u202398
phpcn_u202398原创
2020年04月13日 17:23:05757浏览

1、效果展示

http://192.144.155.203:90/0410/fphp/index.html

2、原代码

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>仿PHP中文网移动端</title>
  7. <style>
  8. @import 'static/css/font.css';
  9. *{
  10. margin: 0px;
  11. padding: 0px;
  12. }
  13. body{
  14. width: 100vw;
  15. background-color: #dcdddd;
  16. display: flex;
  17. flex-flow: column nowrap;
  18. box-sizing: border-box;
  19. }
  20. body >header{
  21. width: 100vw;
  22. height: 3.5rem;
  23. padding: 10px;
  24. background-color: lightslategray;
  25. color: white;
  26. display: flex;
  27. position: fixed;
  28. top:0;
  29. box-sizing: border-box;
  30. }
  31. body > header > a{
  32. text-decoration: none;
  33. color: white;
  34. width: 100vw;
  35. display: flex;
  36. flex-flow: row nowrap;
  37. justify-content: space-between;
  38. align-items: center;
  39. box-sizing: border-box;
  40. }
  41. body >header>a>span:nth-of-type(2)>img{
  42. height: 8vw;
  43. }
  44. body >header>a:hover>span:last-of-type{
  45. color: sienna;
  46. }
  47. body> .solider>a>img{
  48. width: 100vw;
  49. }
  50. body> .solider{
  51. margin-top:4vw;
  52. }
  53. body>.nav{
  54. background-color:white;
  55. width: 100vw;
  56. margin-top: 0.8vw;
  57. display: flex;
  58. flex-flow: column nowrap;
  59. align-content: space-around;
  60. justify-content: center;
  61. box-sizing: border-box;
  62. }
  63. body>.nav>.one,body>.nav>.two{
  64. font-size: 2.5vw;
  65. padding: 3vw;
  66. display: flex;
  67. flex-flow: row nowrap;
  68. justify-content: space-around;
  69. align-content: center;
  70. }
  71. body>.nav>.one>a,body>.nav>.two>a{
  72. text-decoration: none;
  73. color:grey;
  74. display: flex;
  75. flex-flow: column nowrap;
  76. align-items: center;
  77. }
  78. body>.nav>.one>a>span>img,body>.nav>.two>a>span>img{
  79. height: 11vw;
  80. }
  81. body>.nav>.one>a>span:last-of-type,body>.nav>.two>a>span:last-of-type{
  82. margin-top: 1vw;
  83. }
  84. body>.nav>.one>a>span:first-of-type,body>.nav>.two>a>span:first-of-type{
  85. background-color: lightseagreen;
  86. border-radius:3vw ;
  87. padding: -2vw 0vw;
  88. height: 10vw;
  89. }
  90. body>.nav>.one>a:nth-of-type(2)>span:first-of-type{
  91. background-color: tomato;
  92. }
  93. body>.nav>.one>a:nth-of-type(3)>span:first-of-type{
  94. background-color: rgb(53, 223, 129);
  95. }
  96. body>.nav>.one>a:last-of-type>span:first-of-type{
  97. background-color: rgb(179, 99, 136);
  98. }
  99. body>.nav>.two>a:first-of-type>span:first-of-type{
  100. background-color: rgb(235, 127, 65);
  101. }
  102. body>.nav>.two>a:nth-of-type(2)>span:first-of-type{
  103. background-color: rgb(38, 143, 192);
  104. }
  105. body>.nav>.two>a:nth-of-type(3)>span:first-of-type{
  106. background-color: rgb(56, 143, 30);
  107. }
  108. body>.nav>.two>a:last-of-type>span:first-of-type{
  109. background-color: rgb(255, 116, 123);
  110. }
  111. body>h3{
  112. margin: 6vw 2vw 2vw 2vw;
  113. color: #7d7d7d;
  114. }
  115. body>.tj1{
  116. display: flex;
  117. box-sizing: border-box;
  118. }
  119. body>.tj1>a{
  120. width: 100vw;
  121. display: flex;
  122. flex-flow: row nowrap;
  123. justify-content: space-between;
  124. box-sizing: border-box;
  125. }
  126. body>.tj1>a>img{
  127. width: 49vw;
  128. height: 24vw;
  129. } body>.tj2>.t>a>img,body>.gx>.t>a>img,body>.wz>.t>a>img{
  130. width: 41vw;
  131. height: 20vw;
  132. }
  133. body>.tj2,body>.gx,body>.wz{
  134. width: 100vw;
  135. display: flex;
  136. flex-flow:column nowrap;
  137. align-content: center;
  138. }
  139. body>.tj2>.t,body>.gx>.t{
  140. margin-top: 2vw;
  141. background-color: white;
  142. height: 22vw;
  143. padding-left: 2vw;
  144. padding-top: 2vw;
  145. display: flex;
  146. flex-flow:row nowrap;
  147. align-items: flex-start;
  148. }
  149. body>.tj2>.t>div,body>.gx>.t>div,body>.wz>.t>div{
  150. padding-left: 3vw;
  151. display: flex;
  152. flex-flow: column nowrap;
  153. justify-content:space-around;
  154. }
  155. body>.tj2>.t>div>a,body>.gx>.t>div>a,body>.wz>.t>div>a{
  156. text-decoration: none;
  157. color: #7d7d7d;
  158. font-size: 3vw;
  159. }
  160. body>.tj2>.t>div>p{
  161. padding-top: 2vw;
  162. font-size: 2.5vw;
  163. color: #7d7d7d;
  164. display: flex;
  165. flex-flow: row nowrap;
  166. justify-content:flex-start
  167. }
  168. body>.tj2>.t>div>p>span:first-of-type,body>.gx>.t>div>p>span:first-of-type{
  169. background-color: gray;
  170. color:white;
  171. border-radius: 2vw;
  172. margin-right: 1vw;
  173. }
  174. body>.gx>.t>div>p{
  175. padding-top: 2vw;
  176. font-size: 2.5vw;
  177. color: #7d7d7d;
  178. }
  179. body>.gx>.t>div>p:last-of-type{
  180. margin-right: 5vw;
  181. display: flex;
  182. flex-flow: row nowrap;
  183. justify-content:space-between
  184. }
  185. body>.wz>.t>div>span{
  186. font-size: 2.5vw;
  187. color: #7d7d7d;
  188. margin-top: 2vw;
  189. }
  190. body>.wz>.t>div{
  191. margin-right: 3vw ;
  192. }
  193. body>.wz>.t{
  194. margin-top: 2vw;
  195. background-color: white;
  196. height: 22vw;
  197. padding-left: 2vw;
  198. padding-top: 2vw;
  199. display: flex;
  200. flex-flow:row nowrap;
  201. align-items: flex-start;
  202. justify-content: space-between;
  203. }
  204. body>.bw,body>.wd{
  205. width: 100vw;
  206. display: flex;
  207. flex-flow: column nowrap;
  208. justify-content: flex-start;
  209. }
  210. body>.bw>a,body>.wd>a{
  211. background-color: white;
  212. width: 100vw;
  213. margin-top: 2vw;
  214. text-decoration: none;
  215. padding: 3vw;
  216. display: flex;
  217. flex-flow: row nowrap;
  218. justify-content: space-between;
  219. box-sizing: border-box;
  220. }
  221. body>.bw>a:first-of-type,body>.wd>a:first-of-type{
  222. margin-top: 0vw;
  223. }
  224. body>.bw>a>span:first-of-type,body>.wd>a>span:first-of-type{
  225. font-size: 3vw;
  226. color: #7d7d7d;
  227. }
  228. body>.bw>a>span:last-of-type,body>.wd>a>span:last-of-type{
  229. font-size: 2.5vw;
  230. color: #7d7d7d;
  231. }
  232. body>footer{
  233. width: 100vw;
  234. padding: 2vw;
  235. height: 3.5rem;
  236. background-color:#afafb0;
  237. border-top: 0.3vw solid #afafb0;
  238. color: white;
  239. display: flex;
  240. flex-flow: row nowrap;
  241. justify-content:space-around;
  242. box-sizing: border-box;
  243. position: fixed;
  244. bottom:0;
  245. }
  246. body>footer>a{
  247. margin-top: -2vw;
  248. text-decoration: none;
  249. color: white;
  250. display: flex;
  251. flex-flow: column nowrap;
  252. align-content: center;
  253. }
  254. body>footer>a:hover{
  255. color: lightsalmon;
  256. }
  257. body>footer>a:visited:first-of-type{
  258. color: lightsalmon;
  259. }
  260. </style>
  261. </head>
  262. <body>
  263. <header>
  264. <a href="">
  265. <span class="iconfont">&#xe7b5;</span>
  266. <span><img src="static/images/logo.png"> </span>
  267. <span class="iconfont">&#xe6fd;</span>
  268. </a>
  269. </header>
  270. <div class="solider">
  271. <a href="">
  272. <img src="static/images/1.jpg">
  273. </a>
  274. </div>
  275. <div class="nav">
  276. <div class="one">
  277. <a href="">
  278. <span><img src="static/images/code.png"></span>
  279. <span>HTML/CSS</span>
  280. </a>
  281. <a href="">
  282. <span><img src="static/images/code.png"></span>
  283. <span>JavaScript</span>
  284. </a>
  285. <a href="">
  286. <span><img src="static/images/ali-clould.png"></span>
  287. <span>服务端</span>
  288. </a>
  289. <a href="">
  290. <span><img src="static/images/integral.png"></span>
  291. <span>数据库</span>
  292. </a>
  293. </div>
  294. <div class="two">
  295. <a href="">
  296. <span><img src="static/images/mobile-phone.png"></span>
  297. <span>移动端</span>
  298. </a>
  299. <a href="">
  300. <span><img src="static/images/template.png"></span>
  301. <span>手册</span>
  302. </a>
  303. <a href="">
  304. <span><img src="static/images/tool.png"></span>
  305. <span>工具</span>
  306. </a>
  307. <a href="">
  308. <span><img src="static/images/robot.png"></span>
  309. <span>直播</span>
  310. </a>
  311. </div>
  312. </div>
  313. <h3>推荐课程</h3>
  314. <div class="tj1">
  315. <a href="">
  316. <img src="static/images/t1.jpg">
  317. <img src="static/images/t2.jpg">
  318. </a>
  319. </div>
  320. <div class="tj2">
  321. <div class="t">
  322. <a href="">
  323. <img src="static/images/t3.jpg">
  324. </a>
  325. <div>
  326. <a href="">CI框架30分钟极速入门</a>
  327. <p>
  328. <span>中级</span>
  329. <span>2565757次播放</span>
  330. </p>
  331. </div>
  332. </div>
  333. <div class="t">
  334. <a href="">
  335. <img src="static/images/t4.jpg">
  336. </a>
  337. <div>
  338. <a href="">2018前端入门_HTML5</a>
  339. <p>
  340. <span>初级</span>
  341. <span>310408次播放</span>
  342. </p>
  343. </div>
  344. </div>
  345. </div>
  346. <h3>最新更新</h3>
  347. <div class="gx">
  348. <div class="t">
  349. <a href="">
  350. <img src="static/images/g1.png">
  351. </a>
  352. <div>
  353. <a href="">PHP快速操控Excel之PhpSpreadsheet</a>
  354. <p>老的PHPExcel已经停止更新了!目前最新...</p>
  355. <p>
  356. <span>中级</span>
  357. <span>2565757次播放</span>
  358. </p>
  359. </div>
  360. </div>
  361. <div class="t">
  362. <a href="">
  363. <img src="static/images/g2.png">
  364. </a>
  365. <div>
  366. <a href="">Thinkphp6.0正式版视频教程</a>
  367. <p>Thinkphp6.0从2019年10月24日正式发布...</p>
  368. <p>
  369. <span>中级</span>
  370. <span>2565757次播放</span>
  371. </p>
  372. </div>
  373. </div>
  374. <div class="t">
  375. <a href="">
  376. <img src="static/images/g3.jpg">
  377. </a>
  378. <div>
  379. <a href="">2019python自学视频</a>
  380. <p>本课程适合想从零开始学习 Python 编程...</p>
  381. <p>
  382. <span>初级</span>
  383. <span>2565757次播放</span>
  384. </p>
  385. </div>
  386. </div>
  387. <div class="t">
  388. <a href="">
  389. <img src="static/images/g4.png">
  390. </a>
  391. <div>
  392. <a href="">PHP开发免费公益直播课</a>
  393. <p>主讲:php中文网-朱老师( Peter Zhu)...</p>
  394. <p>
  395. <span>初级</span>
  396. <span>2565757次播放</span>
  397. </p>
  398. </div>
  399. </div>
  400. <div class="t">
  401. <a href="">
  402. <img src="static/images/g5.png">
  403. </a>
  404. <div>
  405. <a href="">从零开始到WEB响应式布局</a>
  406. <p>重点介绍了HTML、CSS、web布局前端核心...</p>
  407. <p>
  408. <span>初级</span>
  409. <span>2565757次播放</span>
  410. </p>
  411. </div>
  412. </div>
  413. <div class="t">
  414. <a href="">
  415. <img src="static/images/g6.png">
  416. </a>
  417. <div>
  418. <a href="">PHP文件基础操作</a>
  419. <p>好多同学在PHP基础的时候对PHP文件的...</p>
  420. <p>
  421. <span>中级</span>
  422. <span>2565757次播放</span>
  423. </p>
  424. </div>
  425. </div>
  426. </div>
  427. <h3>最新文章</h3>
  428. <div class="wz">
  429. <div class="t">
  430. <div>
  431. <a href="">thinkphp5 + barcode 生成条形码的方法</a>
  432. <span>发布时间:2020-04-12</span>
  433. </div>
  434. <a href="">
  435. <img src="static/images/z1.jpg">
  436. </a>
  437. </div>
  438. <div class="t">
  439. <div>
  440. <a href="">如何使用html+css+js实现3D相册</a>
  441. <span>发布时间:2020-04-12</span>
  442. </div>
  443. <a href="">
  444. <img src="static/images/z2.png">
  445. </a>
  446. </div>
  447. <div class="t">
  448. <div>
  449. <a href="">Laravel 之 广播 模块详解</a>
  450. <span>发布时间:2020-04-12</span>
  451. </div>
  452. <a href="">
  453. <img src="static/images/z3.jpg">
  454. </a>
  455. </div>
  456. <div class="t">
  457. <div>
  458. <a href="">mysql中key 、primary key 、unique ...</a>
  459. <span>发布时间:2020-04-12</span>
  460. </div>
  461. <a href="">
  462. <img src="static/images/z4.png">
  463. </a>
  464. </div>
  465. <div class="t">
  466. <div>
  467. <a href="">升级后的phpmyadmin 打不开怎么办</a>
  468. <span>发布时间:2020-04-12
  469. </span>
  470. </div>
  471. <a href>
  472. <img src="static/images/z5.jpg">
  473. </a>
  474. </div>
  475. </div>
  476. <div style="margin: 3vw 0vw 0vw 0vw;width:100vw;box-sizing: border-box;background-color: white;width: 100vw;text-align: center;padding: 2vw;"><a href="" style="text-decoration: none;color:#7d7d7d;">更多内容</a></div>
  477. <h3>最新博文</h3>
  478. <div class="bw">
  479. <a href="">
  480. <span>CSS3:弹性盒子flex布局</span>
  481. <span>2020-04-12</span>
  482. </a>
  483. <a href="">
  484. <span>Jquery+AJAX上传文件,无刷新上传并重命名文件</span>
  485. <span>2020-04-11</span>
  486. </a>
  487. <a href="">
  488. <span>thinkphp5.6源码阅读1</span>
  489. <span>2020-04-11</span>
  490. </a>
  491. <a href="">
  492. <span>Composer windows安装详细介绍</span>
  493. <span>2020-04-10</span>
  494. </a>
  495. <a href="">
  496. <span>AI智能电销机器人源码 源码解读(1)—基础</span>
  497. <span>2020-04-10</span>
  498. </a>
  499. </div>
  500. <div style="margin: 3vw 0vw 0vw 0vw;width:100vw;box-sizing: border-box;background-color: white;width: 100vw;text-align: center;padding: 2vw;"><a href="" style="text-decoration: none;color:#7d7d7d;">更多内容</a></div>
  501. <h3>最新问答</h3>
  502. <div class="wd">
  503. <a href="">
  504. <span>url访问admin下的控制器的方法,有问题</span>
  505. <span>2020-04-12</span>
  506. </a>
  507. <a href="">
  508. <span>php+workerman实现新订单提示语音</span>
  509. <span>2020-04-12</span>
  510. </a>
  511. <a href="">
  512. <span>不出现tp6.0页面</span>
  513. <span>2020-04-12</span>
  514. </a>
  515. <a href="">
  516. <span>数据库密码··</span>
  517. <span>2020-04-12</span>
  518. </a>
  519. <a href="">
  520. <span>制定的学习计划在哪能找到 咋找不到呢?</span>
  521. <span>2020-04-10</span>
  522. </a>
  523. </div>
  524. <div style="margin: 3vw 0vw 20vw 0vw;width:100vw;box-sizing: border-box;background-color: white;width: 100vw;text-align: center;padding: 2vw;"><a href="" style="text-decoration: none;color:#7d7d7d;">更多内容</a></div>
  525. <footer>
  526. <a href="" >
  527. <span class="iconfont">&#xe7a7;</span>
  528. <span>首页</span>
  529. </a>
  530. <a href="">
  531. <span class="iconfont">&#xe8c1;</span>
  532. <span>视频</span>
  533. </a>
  534. <a href="">
  535. <span class="iconfont">&#xe7b3;</span>
  536. <span>社区</span>
  537. </a>
  538. <a href="">
  539. <span class="iconfont">&#xe7b5;</span>
  540. <span>我的</span>
  541. </a>
  542. </footer>
  543. </body>
  544. </html>

3、学习总结

本节课我们进行了一个小的仿站实战课,是对前面知识的一个综合应用,主要运用的知识包括:伪类选择器,flex布局等。通过实战让我感觉到了使用flex布局能够快速的将一个页面框架搭建起来,使用方便,快捷,代码量少。伪类选择器能够快速的定位到自己需要设置标签的标签上,使用起来也很方便。在整个实战结束以后与其他同学的相比较,我的不足之处在于页面的配色上,这个需要提高一下自己的美术功底,以后做出来的页面配色让浏览者看了以后有一种赏心悦目的感觉。

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