Blogger Information
Blog 40
fans 0
comment 0
visits 27875
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
大气红色新闻手机端
初见
Original
618 people have browsed it

新闻手机端

  • 首页效果

新闻手机端

  • html代码
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  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>新闻首页</title>
  8. <link rel="stylesheet" href="css/style.css" />
  9. <link rel="stylesheet" href="font/iconfont.css" />
  10. </head>
  11. <body>
  12. <div class="box">
  13. <div class="header">
  14. <a href=""
  15. ><span class="iconfont icon-qiandao"> <span>签到</span></span></a
  16. >
  17. <div class="search">
  18. <span class="iconfont icon-sousuo"></span>
  19. <form action="">
  20. <input
  21. type="text"
  22. class="soso"
  23. placeholder="请输入你要搜索的关键词"
  24. />
  25. <button></button>
  26. </form>
  27. <a href=""><span class="iconfont icon-paizhao"></span></a>
  28. </div>
  29. <a href=""
  30. ><span class="iconfont icon-xiaoxi"> <span>消息</span></span></a
  31. >
  32. </div>
  33. <div class="navs">
  34. <li><a href="">推荐</a></li>
  35. <li><a href="">关注</a></li>
  36. <li><a href="">头条</a></li>
  37. <li><a href="">热点</a></li>
  38. <li><a href="">娱乐</a></li>
  39. <li><a href="">健康</a></li>
  40. <li><a href="">美食</a></li>
  41. <a href=""><span class="iconfont icon-115-lanmuguanli"></span></a>
  42. </div>
  43. <div class="main">
  44. <ul class="list">
  45. <li class="item">
  46. <h2>
  47. <a href=""
  48. >中国多地停产限电,真的是没电了吗?中美博弈才是关键因素</a
  49. >
  50. </h2>
  51. <div class="img">
  52. <img src="images/pic1.jpg" alt="" />
  53. <img src="images/pic2.jpg" alt="" />
  54. <img src="images/pic3.jpg" alt="" />
  55. </div>
  56. <div class="read">
  57. <div>
  58. <span>置顶</span>
  59. <span>央视新闻</span>
  60. <span>阅读12568</span>
  61. </div>
  62. <div>
  63. <span><span class="iconfont icon-pinglun"></span> 152评论</span>
  64. <span><span class="iconfont icon-dianzan"></span> 389点赞</span>
  65. </div>
  66. </div>
  67. </li>
  68. <li class="item">
  69. <h2>
  70. <a href=""
  71. >3年“败光”百亿,花3亿投资又被王思聪讽刺,陈欧比你想象传奇</a
  72. >
  73. </h2>
  74. <div class="img">
  75. <img src="images/pic4.jpg" alt="" />
  76. <img src="images/pic5.jpg" alt="" />
  77. <img src="images/pic6.jpg" alt="" />
  78. </div>
  79. <div class="read">
  80. <div>
  81. <span>置顶</span>
  82. <span>央视新闻</span>
  83. <span>阅读12568</span>
  84. </div>
  85. <div>
  86. <span><span class="iconfont icon-pinglun"></span> 152评论</span>
  87. <span><span class="iconfont icon-dianzan"></span> 389点赞</span>
  88. </div>
  89. </div>
  90. </li>
  91. <li class="item">
  92. <div class="ajd">
  93. <div class="tit">
  94. <a href=""
  95. >二手房将迎来贬值潮,为什么炒房客不降价抛售?内行指出3个原因</a
  96. >
  97. </div>
  98. <div class="pic">
  99. <img src="images/pic7.jpg" alt="" />
  100. </div>
  101. </div>
  102. <div class="read">
  103. <div>
  104. <span>置顶</span>
  105. <span>央视新闻</span>
  106. <span>阅读12568</span>
  107. </div>
  108. <div>
  109. <span><span class="iconfont icon-pinglun"></span> 152评论</span>
  110. <span><span class="iconfont icon-dianzan"></span> 389点赞</span>
  111. </div>
  112. </div>
  113. </li>
  114. <li class="item">
  115. <h2>
  116. <a href=""
  117. >跟王兴创业的清华高材生,41岁急流勇退,拿1.5亿年薪享受人生</a
  118. >
  119. </h2>
  120. <div class="img">
  121. <img src="images/pic8.jpg" alt="" />
  122. <img src="images/pic9.jpg" alt="" />
  123. <img src="images/pic10.jpg" alt="" />
  124. </div>
  125. <div class="read">
  126. <div>
  127. <span>置顶</span>
  128. <span>央视新闻</span>
  129. <span>阅读12568</span>
  130. </div>
  131. <div>
  132. <span><span class="iconfont icon-pinglun"></span> 152评论</span>
  133. <span><span class="iconfont icon-dianzan"></span> 389点赞</span>
  134. </div>
  135. </div>
  136. </li>
  137. <li class="item">
  138. <h2>
  139. <a href=""
  140. >中国多地停产限电,真的是没电了吗?中美博弈才是关键因素</a
  141. >
  142. </h2>
  143. <div class="img">
  144. <img src="images/pic1.jpg" alt="" />
  145. <img src="images/pic2.jpg" alt="" />
  146. <img src="images/pic3.jpg" alt="" />
  147. </div>
  148. <div class="read">
  149. <div>
  150. <span>置顶</span>
  151. <span>央视新闻</span>
  152. <span>阅读12568</span>
  153. </div>
  154. <div>
  155. <span><span class="iconfont icon-pinglun"></span> 152评论</span>
  156. <span><span class="iconfont icon-dianzan"></span> 389点赞</span>
  157. </div>
  158. </div>
  159. </li>
  160. <li class="item">
  161. <h2>
  162. <a href=""
  163. >3年“败光”百亿,花3亿投资又被王思聪讽刺,陈欧比你想象传奇</a
  164. >
  165. </h2>
  166. <div class="img">
  167. <img src="images/pic4.jpg" alt="" />
  168. <img src="images/pic5.jpg" alt="" />
  169. <img src="images/pic6.jpg" alt="" />
  170. </div>
  171. <div class="read">
  172. <div>
  173. <span>置顶</span>
  174. <span>央视新闻</span>
  175. <span>阅读12568</span>
  176. </div>
  177. <div>
  178. <span><span class="iconfont icon-pinglun"></span> 152评论</span>
  179. <span><span class="iconfont icon-dianzan"></span> 389点赞</span>
  180. </div>
  181. </div>
  182. </li>
  183. <li class="item">
  184. <div class="ajd">
  185. <div class="tit">
  186. <a href=""
  187. >二手房将迎来贬值潮,为什么炒房客不降价抛售?内行指出3个原因</a
  188. >
  189. </div>
  190. <div class="pic">
  191. <img src="images/pic7.jpg" alt="" />
  192. </div>
  193. </div>
  194. <div class="read">
  195. <div>
  196. <span>置顶</span>
  197. <span>央视新闻</span>
  198. <span>阅读12568</span>
  199. </div>
  200. <div>
  201. <span><span class="iconfont icon-pinglun"></span> 152评论</span>
  202. <span><span class="iconfont icon-dianzan"></span> 389点赞</span>
  203. </div>
  204. </div>
  205. </li>
  206. <li class="item">
  207. <h2>
  208. <a href=""
  209. >跟王兴创业的清华高材生,41岁急流勇退,拿1.5亿年薪享受人生</a
  210. >
  211. </h2>
  212. <div class="img">
  213. <img src="images/pic8.jpg" alt="" />
  214. <img src="images/pic9.jpg" alt="" />
  215. <img src="images/pic10.jpg" alt="" />
  216. </div>
  217. <div class="read">
  218. <div>
  219. <span>置顶</span>
  220. <span>央视新闻</span>
  221. <span>阅读12568</span>
  222. </div>
  223. <div>
  224. <span><span class="iconfont icon-pinglun"></span> 152评论</span>
  225. <span><span class="iconfont icon-dianzan"></span> 389点赞</span>
  226. </div>
  227. </div>
  228. </li>
  229. <li class="item">
  230. <h2>
  231. <a href=""
  232. >中国多地停产限电,真的是没电了吗?中美博弈才是关键因素</a
  233. >
  234. </h2>
  235. <div class="img">
  236. <img src="images/pic1.jpg" alt="" />
  237. <img src="images/pic2.jpg" alt="" />
  238. <img src="images/pic3.jpg" alt="" />
  239. </div>
  240. <div class="read">
  241. <div>
  242. <span>置顶</span>
  243. <span>央视新闻</span>
  244. <span>阅读12568</span>
  245. </div>
  246. <div>
  247. <span><span class="iconfont icon-pinglun"></span> 152评论</span>
  248. <span><span class="iconfont icon-dianzan"></span> 389点赞</span>
  249. </div>
  250. </div>
  251. </li>
  252. <li class="item">
  253. <h2>
  254. <a href=""
  255. >3年“败光”百亿,花3亿投资又被王思聪讽刺,陈欧比你想象传奇</a
  256. >
  257. </h2>
  258. <div class="img">
  259. <img src="images/pic4.jpg" alt="" />
  260. <img src="images/pic5.jpg" alt="" />
  261. <img src="images/pic6.jpg" alt="" />
  262. </div>
  263. <div class="read">
  264. <div>
  265. <span>置顶</span>
  266. <span>央视新闻</span>
  267. <span>阅读12568</span>
  268. </div>
  269. <div>
  270. <span><span class="iconfont icon-pinglun"></span> 152评论</span>
  271. <span><span class="iconfont icon-dianzan"></span> 389点赞</span>
  272. </div>
  273. </div>
  274. </li>
  275. <li class="item">
  276. <div class="ajd">
  277. <div class="tit">
  278. <a href=""
  279. >二手房将迎来贬值潮,为什么炒房客不降价抛售?内行指出3个原因</a
  280. >
  281. </div>
  282. <div class="pic">
  283. <img src="images/pic7.jpg" alt="" />
  284. </div>
  285. </div>
  286. <div class="read">
  287. <div>
  288. <span>置顶</span>
  289. <span>央视新闻</span>
  290. <span>阅读12568</span>
  291. </div>
  292. <div>
  293. <span><span class="iconfont icon-pinglun"></span> 152评论</span>
  294. <span><span class="iconfont icon-dianzan"></span> 389点赞</span>
  295. </div>
  296. </div>
  297. </li>
  298. <li class="item">
  299. <h2>
  300. <a href=""
  301. >跟王兴创业的清华高材生,41岁急流勇退,拿1.5亿年薪享受人生</a
  302. >
  303. </h2>
  304. <div class="img">
  305. <img src="images/pic8.jpg" alt="" />
  306. <img src="images/pic9.jpg" alt="" />
  307. <img src="images/pic10.jpg" alt="" />
  308. </div>
  309. <div class="read">
  310. <div>
  311. <span>置顶</span>
  312. <span>央视新闻</span>
  313. <span>阅读12568</span>
  314. </div>
  315. <div>
  316. <span><span class="iconfont icon-pinglun"></span> 152评论</span>
  317. <span><span class="iconfont icon-dianzan"></span> 389点赞</span>
  318. </div>
  319. </div>
  320. </li>
  321. <li class="item">
  322. <h2>
  323. <a href=""
  324. >中国多地停产限电,真的是没电了吗?中美博弈才是关键因素</a
  325. >
  326. </h2>
  327. <div class="img">
  328. <img src="images/pic1.jpg" alt="" />
  329. <img src="images/pic2.jpg" alt="" />
  330. <img src="images/pic3.jpg" alt="" />
  331. </div>
  332. <div class="read">
  333. <div>
  334. <span>置顶</span>
  335. <span>央视新闻</span>
  336. <span>阅读12568</span>
  337. </div>
  338. <div>
  339. <span><span class="iconfont icon-pinglun"></span> 152评论</span>
  340. <span><span class="iconfont icon-dianzan"></span> 389点赞</span>
  341. </div>
  342. </div>
  343. </li>
  344. <li class="item">
  345. <h2>
  346. <a href=""
  347. >3年“败光”百亿,花3亿投资又被王思聪讽刺,陈欧比你想象传奇</a
  348. >
  349. </h2>
  350. <div class="img">
  351. <img src="images/pic4.jpg" alt="" />
  352. <img src="images/pic5.jpg" alt="" />
  353. <img src="images/pic6.jpg" alt="" />
  354. </div>
  355. <div class="read">
  356. <div>
  357. <span>置顶</span>
  358. <span>央视新闻</span>
  359. <span>阅读12568</span>
  360. </div>
  361. <div>
  362. <span><span class="iconfont icon-pinglun"></span> 152评论</span>
  363. <span><span class="iconfont icon-dianzan"></span> 389点赞</span>
  364. </div>
  365. </div>
  366. </li>
  367. <li class="item">
  368. <div class="ajd">
  369. <div class="tit">
  370. <a href=""
  371. >二手房将迎来贬值潮,为什么炒房客不降价抛售?内行指出3个原因</a
  372. >
  373. </div>
  374. <div class="pic">
  375. <img src="images/pic7.jpg" alt="" />
  376. </div>
  377. </div>
  378. <div class="read">
  379. <div>
  380. <span>置顶</span>
  381. <span>央视新闻</span>
  382. <span>阅读12568</span>
  383. </div>
  384. <div>
  385. <span><span class="iconfont icon-pinglun"></span> 152评论</span>
  386. <span><span class="iconfont icon-dianzan"></span> 389点赞</span>
  387. </div>
  388. </div>
  389. </li>
  390. <li class="item">
  391. <h2>
  392. <a href=""
  393. >跟王兴创业的清华高材生,41岁急流勇退,拿1.5亿年薪享受人生</a
  394. >
  395. </h2>
  396. <div class="img">
  397. <img src="images/pic8.jpg" alt="" />
  398. <img src="images/pic9.jpg" alt="" />
  399. <img src="images/pic10.jpg" alt="" />
  400. </div>
  401. <div class="read">
  402. <div>
  403. <span>置顶</span>
  404. <span>央视新闻</span>
  405. <span>阅读12568</span>
  406. </div>
  407. <div>
  408. <span><span class="iconfont icon-pinglun"></span> 152评论</span>
  409. <span><span class="iconfont icon-dianzan"></span> 389点赞</span>
  410. </div>
  411. </div>
  412. </li>
  413. <li class="item">
  414. <h2>
  415. <a href=""
  416. >中国多地停产限电,真的是没电了吗?中美博弈才是关键因素</a
  417. >
  418. </h2>
  419. <div class="img">
  420. <img src="images/pic1.jpg" alt="" />
  421. <img src="images/pic2.jpg" alt="" />
  422. <img src="images/pic3.jpg" alt="" />
  423. </div>
  424. <div class="read">
  425. <div>
  426. <span>置顶</span>
  427. <span>央视新闻</span>
  428. <span>阅读12568</span>
  429. </div>
  430. <div>
  431. <span><span class="iconfont icon-pinglun"></span> 152评论</span>
  432. <span><span class="iconfont icon-dianzan"></span> 389点赞</span>
  433. </div>
  434. </div>
  435. </li>
  436. <li class="item">
  437. <h2>
  438. <a href=""
  439. >3年“败光”百亿,花3亿投资又被王思聪讽刺,陈欧比你想象传奇</a
  440. >
  441. </h2>
  442. <div class="img">
  443. <img src="images/pic4.jpg" alt="" />
  444. <img src="images/pic5.jpg" alt="" />
  445. <img src="images/pic6.jpg" alt="" />
  446. </div>
  447. <div class="read">
  448. <div>
  449. <span>置顶</span>
  450. <span>央视新闻</span>
  451. <span>阅读12568</span>
  452. </div>
  453. <div>
  454. <span><span class="iconfont icon-pinglun"></span> 152评论</span>
  455. <span><span class="iconfont icon-dianzan"></span> 389点赞</span>
  456. </div>
  457. </div>
  458. </li>
  459. <li class="item">
  460. <div class="ajd">
  461. <div class="tit">
  462. <a href=""
  463. >二手房将迎来贬值潮,为什么炒房客不降价抛售?内行指出3个原因</a
  464. >
  465. </div>
  466. <div class="pic">
  467. <img src="images/pic7.jpg" alt="" />
  468. </div>
  469. </div>
  470. <div class="read">
  471. <div>
  472. <span>置顶</span>
  473. <span>央视新闻</span>
  474. <span>阅读12568</span>
  475. </div>
  476. <div>
  477. <span><span class="iconfont icon-pinglun"></span> 152评论</span>
  478. <span><span class="iconfont icon-dianzan"></span> 389点赞</span>
  479. </div>
  480. </div>
  481. </li>
  482. <li class="item">
  483. <h2>
  484. <a href=""
  485. >跟王兴创业的清华高材生,41岁急流勇退,拿1.5亿年薪享受人生</a
  486. >
  487. </h2>
  488. <div class="img">
  489. <img src="images/pic8.jpg" alt="" />
  490. <img src="images/pic9.jpg" alt="" />
  491. <img src="images/pic10.jpg" alt="" />
  492. </div>
  493. <div class="read">
  494. <div>
  495. <span>置顶</span>
  496. <span>央视新闻</span>
  497. <span>阅读12568</span>
  498. </div>
  499. <div>
  500. <span><span class="iconfont icon-pinglun"></span> 152评论</span>
  501. <span><span class="iconfont icon-dianzan"></span> 389点赞</span>
  502. </div>
  503. </div>
  504. </li>
  505. </ul>
  506. </div>
  507. <div class="footer">
  508. <a href=""
  509. ><div>
  510. <span class="iconfont icon-shouye"></span>
  511. <span>首页</span>
  512. </div></a
  513. >
  514. <a href=""
  515. ><div>
  516. <span class="iconfont icon-shipin"></span>
  517. <span>视频</span>
  518. </div></a
  519. >
  520. <a href=""
  521. ><div>
  522. <span class="iconfont icon-24gl-newspaper"></span>
  523. <span>新闻</span>
  524. </div></a
  525. >
  526. <a href=""
  527. ><div>
  528. <span class="iconfont icon-shouye"></span>
  529. <span>任务</span>
  530. </div></a
  531. >
  532. <a href=""
  533. ><div>
  534. <span class="iconfont icon-wode"></span>
  535. <span>我的</span>
  536. </div></a
  537. >
  538. </div>
  539. </div>
  540. </body>
  541. </html>
  • css代码
  1. /* 通用css */
  2. * {
  3. margin: 0;
  4. padding: 0;
  5. box-sizing: border-box;
  6. }
  7. html {
  8. font-size: 10px;
  9. }
  10. body {
  11. font-size: 1.6rem;
  12. background-color: #fff;
  13. }
  14. a {
  15. color: #333;
  16. text-decoration: none;
  17. }
  18. li {
  19. list-style: none;
  20. }
  21. @media screen(min-width:480px) {
  22. font-size: 12px;
  23. }
  24. @media screen(min-width:640px) {
  25. font-size: 14px;
  26. }
  27. @media screen(min-width:720px) {
  28. font-size: 16px;
  29. }
  30. .box {
  31. min-height: 100vh;
  32. display: grid;
  33. grid-template-rows: 5rem 4rem 1fr 5rem;
  34. }
  35. /* 顶部css */
  36. .box .header {
  37. background-color: #f93442;
  38. display: grid;
  39. grid-template-columns: 4rem 1fr 4rem;
  40. place-items: center;
  41. color: #fff;
  42. }
  43. .box .header .icon-qiandao,
  44. .box .header .icon-xiaoxi {
  45. display: grid;
  46. flex-flow: column nowrap;
  47. font-size: 2.2rem;
  48. color: #fff;
  49. }
  50. .box .header .icon-qiandao span,
  51. .box .header .icon-xiaoxi span {
  52. font-size: 1rem;
  53. font-weight: 400;
  54. }
  55. .box .header .search {
  56. display: grid;
  57. grid-template-columns: 4rem 1fr 4rem;
  58. background-color: #fff;
  59. border-radius: 0.3rem;
  60. place-items: center;
  61. line-height: 3.2rem;
  62. color: #666;
  63. width: 98%;
  64. }
  65. .box .header .search .iconfont {
  66. font-size: 1.8rem;
  67. place-self: center;
  68. }
  69. .box .header .search form {
  70. width: 100%;
  71. }
  72. .box .header .search .soso {
  73. line-height: 3.2rem;
  74. border: 0;
  75. outline: none;
  76. overflow: hidden;
  77. }
  78. .box .header .search button {
  79. width: 0;
  80. height: 0;
  81. }
  82. .box .navs {
  83. background-color: #efefef;
  84. line-height: 4rem;
  85. display: flex;
  86. flex-wrap: nowrap;
  87. place-content: space-around;
  88. }
  89. .box .navs a {
  90. color: #777;
  91. }
  92. .box .navs li:first-of-type {
  93. font-weight: bolder;
  94. }
  95. /* 主体css */
  96. .box .main {
  97. height: calc(100vh - 4rem - 5rem - 5rem);
  98. overflow-y: scroll;
  99. }
  100. ul.list {
  101. overflow: hidden;
  102. }
  103. ul.list li.item {
  104. padding: 1rem 1rem;
  105. }
  106. ul.list li.item h2 {
  107. font-size: 1.7rem;
  108. font-weight: inherit;
  109. line-height: 2.5rem;
  110. text-align: justify;
  111. }
  112. ul.list li.item .img {
  113. padding-top: 0.6rem;
  114. display: flex;
  115. flex-wrap: nowrap;
  116. place-content: space-between;
  117. }
  118. ul.list li.item .img img {
  119. width: 32%;
  120. border-radius: 0.5rem;
  121. }
  122. ul.list li.item .read {
  123. padding-top: 1rem;
  124. display: flex;
  125. flex-wrap: nowrap;
  126. place-content: space-between;
  127. font-size: 1.2rem;
  128. }
  129. ul.list li.item .read div:first-of-type > :first-of-type {
  130. color: #f93442;
  131. border: 1px #f93442 solid;
  132. font-size: 1rem;
  133. padding: 1px 3px;
  134. border-radius: 3px;
  135. }
  136. ul.list li.item .read div:first-of-type > :nth-of-type(2) {
  137. margin-left: 0.5rem;
  138. }
  139. ul.list li.item .read div:first-of-type > :nth-of-type(3) {
  140. color: #666;
  141. margin-left: 0.5rem;
  142. }
  143. ul.list li.item .read div:last-of-type {
  144. color: #666;
  145. }
  146. ul.list li.item .read div:last-of-type > :first-of-type {
  147. margin-right: 0.5rem;
  148. }
  149. ul.list li.item .ajd {
  150. display: grid;
  151. grid-template-columns: 1fr 30vw;
  152. gap: 1rem;
  153. }
  154. ul.list li.item .ajd .tit {
  155. line-height: 1.6;
  156. }
  157. ul.list li.item .ajd .pic img {
  158. max-width: 100%;
  159. border-radius: 0.5rem;
  160. min-height: 75px;
  161. }
  162. /* 底部css */
  163. .box .footer {
  164. background-color: #efefef;
  165. border-top: 1px solid #dad9d8;
  166. display: flex;
  167. place-content: space-around;
  168. padding-top: 0.6rem;
  169. }
  170. .box .footer div {
  171. color: #9c9c9c;
  172. display: flex;
  173. flex-flow: column nowrap;
  174. place-items: center;
  175. }
  176. .box .footer a:first-of-type div {
  177. color: #f93442;
  178. }
  179. .box .footer a div span:first-of-type {
  180. font-size: 2.2rem;
  181. }
  182. .box .footer a div span:last-of-type {
  183. font-size: 1rem;
  184. }

通过对grid布局和flex布局的初步掌握,基本可以完成一些网站布局,但是flex和grid的布局的强大还需要进一步熟练掌握。

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