博客列表 >grid布局实战+demo项目页面模仿

grid布局实战+demo项目页面模仿

岂几岂几
岂几岂几原创
2020年04月22日 00:13:461185浏览

1. 电子相册

  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>我的相册</title>
  7. <style>
  8. * {
  9. border: 0;
  10. padding: 0;
  11. box-sizing: border-box;
  12. }
  13. body {
  14. background-color:teal;
  15. }
  16. h1 {
  17. text-align: center;
  18. font-weight: 400;
  19. text-shadow: 5px 5px 5px gray;
  20. }
  21. .container {
  22. min-height: 1000px;
  23. display: grid;
  24. grid-template-columns: repeat(auto-fill, 250px);
  25. grid-template-rows: repeat(auto-fill, 330px);
  26. justify-content: space-evenly;
  27. align-content: space-around;
  28. gap: 25px;
  29. }
  30. .container .item {
  31. background-color: white;
  32. padding: 10px;
  33. display: flex;
  34. flex-flow: column nowrap;
  35. justify-content: space-between;
  36. align-items: center;
  37. border-radius: 10px;
  38. }
  39. .container .item:hover {
  40. width:calc(100%*1.02);
  41. box-shadow: 0 0 10px lightgrey;
  42. background-color: wheat;
  43. }
  44. .container .item a:hover {
  45. color: red;
  46. }
  47. .container .item img {
  48. width: 100%;
  49. }
  50. </style>
  51. </head>
  52. <body>
  53. <h1>我的相册</h1>
  54. <div class="container">
  55. <div class="item">
  56. <img src="xc.png" alt="">
  57. <a href="#">照片标题1</a>
  58. </div>
  59. <div class="item">
  60. <img src="xc.png" alt="">
  61. <a href="#">照片标题1</a>
  62. </div>
  63. <div class="item">
  64. <img src="xc.png" alt="">
  65. <a href="#">照片标题2</a>
  66. </div>
  67. <div class="item">
  68. <img src="xc.png" alt="">
  69. <a href="#">照片标题3</a>
  70. </div>
  71. <div class="item">
  72. <img src="xc.png" alt="">
  73. <a href="#">照片标题4</a>
  74. </div>
  75. <div class="item">
  76. <img src="xc.png" alt="">
  77. <a href="#">照片标题5</a>
  78. </div>
  79. <div class="item">
  80. <img src="xc.png" alt="">
  81. <a href="#">照片标题6</a>
  82. </div>
  83. <div class="item">
  84. <img src="xc.png" alt="">
  85. <a href="#">照片标题7</a>
  86. </div>
  87. <div class="item">
  88. <img src="xc.png" alt="">
  89. <a href="#">照片标题8</a>
  90. </div>
  91. <div class="item">
  92. <img src="xc.png" alt="">
  93. <a href="#">照片标题9</a>
  94. </div>
  95. <div class="item">
  96. <img src="xc.png" alt="">
  97. <a href="#">照片标题10</a>
  98. </div>
  99. <div class="item">
  100. <img src="xc.png" alt="">
  101. <a href="#">照片标题11</a>
  102. </div>
  103. <div class="item">
  104. <img src="xc.png" alt="">
  105. <a href="#">照片标题12</a>
  106. </div>
  107. </div>
  108. </body>
  109. </html>

运行效果图:

2. 仿格栅布局组件

  1. 格栅布局组件: /static/css/style.css
  1. /* 把demo1.html中写好的栅格布局样式搬到这里来 */
  2. /* 2.设置通用样式 */
  3. * {
  4. border: 0;
  5. padding: 0;
  6. box-sizing: border-box;
  7. }
  8. /* 3.body看做flex布局, 主轴为垂直方向, 宽高等于100视口, 这样可以撑起宽高 */
  9. body {
  10. display: flex;
  11. flex-flow: column nowrap;
  12. width: 100vw;
  13. height: 100vh;
  14. justify-content: start;
  15. align-items: center;
  16. }
  17. /* 4.格栅布局的容器 */
  18. .container {
  19. /* 4.0.设置容器最小宽度,以撑起空间 */
  20. min-width: 1000px;
  21. /* 4.1.生成grid容器(感觉设置成flex布局也OK,反正都是部署成一列) */
  22. display: grid;
  23. /* 4.2.不设置显示生成单元格样式时,grid布局默认是生成一列多行式布局 */
  24. /* 4.3.设置网格区域之间的间隙宽度为5px */
  25. row-gap: 5px;
  26. }
  27. /* 5.格栅布局的行 */
  28. .row {
  29. width: 100%;
  30. /* 5.1.设置为grid布局 */
  31. display: grid;
  32. /* 行优先(默认就是,其实可以省略) */
  33. grid-auto-flow: row;
  34. /* 5.2.只设置显示生成单元格的列数量,平均分配为12列 */
  35. grid-template-columns: repeat(12, 1fr);
  36. /* 默认就是,其实可以省略 */
  37. grid-template-rows: repeat(1, 1fr);
  38. /* 5.3.网格区域之间的间隙 */
  39. gap: 5px;
  40. }
  41. /* 6.栅格中的共通样式 */
  42. .item {
  43. border: 1px solid;
  44. min-height: 50px;
  45. }
  46. /* 7.设置不同大小栅格(项目)的布局样式 */
  47. .col-1 {
  48. /* 布局占1列 */
  49. grid-column-end: span 1;
  50. }
  51. .col-2 {
  52. /* 布局占2列 */
  53. grid-column-end: span 2;
  54. }
  55. .col-3 {
  56. /* 布局占3列 */
  57. grid-column-end: span 3;
  58. }
  59. .col-4 {
  60. grid-column-end: span 4;
  61. }
  62. .col-5 {
  63. grid-column-end: span 5;
  64. }
  65. .col-6 {
  66. grid-column-end: span 6;
  67. }
  68. .col-7 {
  69. grid-column-end: span 7;
  70. }
  71. .col-8 {
  72. grid-column-end: span 8;
  73. }
  74. .col-9 {
  75. grid-column-end: span 9;
  76. }
  77. .col-10 {
  78. grid-column-end: span 10;
  79. }
  80. .col-11 {
  81. grid-column-end: span 11;
  82. }
  83. .col-12 {
  84. grid-column-end: span 12;
  85. }
  1. 自定义格栅布局使用 /demo1.html
  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>自定义格栅布局使用</title>
  7. <style>
  8. @import url('static/css/style.css');
  9. </style>
  10. </head>
  11. <body>
  12. <!-- 1.先照bootstrap的山歌布局结构写出HTML结构 -->
  13. <div class="container">
  14. <!-- 创建行 -->
  15. <div class="row">
  16. <!-- 创建列(两列) -->
  17. <div class="item col-6">6</div>
  18. <div class="item col-6">6</div>
  19. </div>
  20. <!-- 1.END -->
  21. <!-- 自制山歌布局其他测试 -->
  22. <!-- 创建行 -->
  23. <div class="row">
  24. <!-- 创建列(三列) -->
  25. <div class="item col-2">2</div>
  26. <div class="item col-8">8</div>
  27. <div class="item col-2">2</div>
  28. </div>
  29. <!-- 创建行 -->
  30. <div class="row">
  31. <!-- 创建列(十二列) -->
  32. <div class="item">1</div>
  33. <div class="item">2</div>
  34. <div class="item">3</div>
  35. <div class="item">4</div>
  36. <div class="item">5</div>
  37. <div class="item">6</div>
  38. <div class="item">7</div>
  39. <div class="item">8</div>
  40. <div class="item">9</div>
  41. <div class="item">10</div>
  42. <div class="item">11</div>
  43. <div class="item">12</div>
  44. </div>
  45. <!-- 创建行 -->
  46. <div class="row">
  47. <!-- 创建列(不布局完) -->
  48. <div class="item col-2">2</div>
  49. <div class="item col-8">8</div>
  50. </div>
  51. </div>
  52. </body>
  53. </html>

运行效果图:

3. 模仿实战项目页面

首页模仿

  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>Document</title>
  7. <style>
  8. @import url('static/font_icon/iconfont.css');
  9. * {
  10. margin: 0;
  11. padding: 0;
  12. box-sizing: border-box;
  13. }
  14. li {
  15. list-style-type: none;
  16. }
  17. body {
  18. font-size: 14px;
  19. width: 100vw;
  20. height: 100vh;
  21. }
  22. header {
  23. background-color: black;
  24. color: #ccc;
  25. width: 100%;
  26. height: 44px;
  27. padding: 0 20px;
  28. display: flex;
  29. flex-flow: row nowrap;
  30. justify-content: space-between;
  31. align-items: center;
  32. }
  33. header a {
  34. color: inherit;
  35. margin-right: 20px;
  36. text-decoration: none;
  37. }
  38. header>.right a {
  39. margin-right: unset;
  40. margin-left: 20px;
  41. }
  42. section{
  43. width: 100%;
  44. }
  45. section:first-of-type
  46. , section:nth-of-type(3) {
  47. /* width: 100%; */
  48. background-color: #fafafa;
  49. padding-bottom: 30px;
  50. }
  51. section:first-of-type>*>* {
  52. max-width: 1200px;
  53. margin: 0 auto;
  54. }
  55. section:not(:first-of-type)>* {
  56. max-width: 1200px;
  57. margin: 0 auto;
  58. }
  59. section>.top>.top-header {
  60. /* max-width: 1050px; */
  61. /* margin: 0 auto; */
  62. display: flex;
  63. flex-flow: row nowrap;
  64. justify-content: space-between;
  65. align-items: center;
  66. }
  67. section>.top>.top-header>.right {
  68. height: 36px;
  69. display: flex;
  70. flex-flow: row nowrap;
  71. align-items: start;
  72. position: relative;
  73. }
  74. section>.top>.top-header>.right>input {
  75. height: 36px;
  76. width: 319px;
  77. border: 1px solid #aaa;
  78. border-radius: 10px;
  79. }
  80. section>.top>.top-header>.right>input:hover {
  81. box-shadow: 0 0 5px #aaa;
  82. }
  83. section>.top>.top-header>.right>span {
  84. position: absolute;
  85. font-size: 1.5rem;
  86. color: #aaa;
  87. top: 4px;
  88. left: 290px;
  89. cursor: pointer;
  90. }
  91. section>.top>.top-header>.right>a:first-of-type {
  92. margin-left: 40px;
  93. }
  94. section>.top>.top-header>.right>a:not(:first-of-type) {
  95. margin-left: 20px;
  96. }
  97. section>.top>.top-header>.right>a>span {
  98. font-size: 33px;
  99. height: 36px;
  100. line-height: 36px;
  101. display: inline-block;
  102. text-decoration: none;
  103. color: #666;
  104. }
  105. section>.top>.nav{
  106. /* max-width: 1050px; */
  107. /* margin: 0 auto; */
  108. display: flex;
  109. flex-flow: row nowrap;
  110. justify-content: start;
  111. align-items:stretch;
  112. }
  113. section>.top>.nav>.nav-box {
  114. display: grid;
  115. grid-auto-flow: row;
  116. grid-template-columns: repeat(6, 1fr);
  117. grid-template-rows: repeat(2, 1fr);
  118. margin-right: 30px;
  119. flex: 1 1 auto;
  120. }
  121. section>.top>.nav>.nav-box>span{
  122. font-size: 40px;
  123. display: inline-block;
  124. grid-row-end: span 2;
  125. color: red;
  126. }
  127. section>.top>.nav>.nav-box>a {
  128. display: inline-block;
  129. text-align: center;
  130. text-decoration: none;
  131. color: #666;
  132. }
  133. section>.top>.nav>.nav-box>a:nth-of-type(5n+1) {
  134. border-right: 1px solid #999;
  135. }
  136. section>.top>.lunbo {
  137. margin-top: 20px;
  138. display:flex;
  139. flex-flow: row nowrap;
  140. justify-content: space-between;
  141. }
  142. section>.top>.lunbo>img:first-of-type{
  143. width: 75%;
  144. flex: 3 3 auto;
  145. margin-right: 10px;
  146. }
  147. section>.top>.lunbo>img:last-of-type {
  148. width: 25%;
  149. flex: 1 1 auto;
  150. }
  151. section>.top>.lunbo>img:hover {
  152. box-shadow: 0 0 5px #666;
  153. }
  154. section:nth-of-type(2) {
  155. /* width: 100%; */
  156. background-color: #ddd;
  157. padding-bottom: 10px;
  158. }
  159. section:nth-of-type(2)>.section-box:first-child {
  160. background-color: #fafafa;
  161. height: 520px;
  162. margin-bottom: 10px;
  163. }
  164. section>.section-box>.title{
  165. background-color: #ddd;
  166. height: 100px;
  167. line-height: 100px;
  168. text-align: center;
  169. }
  170. section>.section-box>.title> span {
  171. border-bottom: 2px solid orange;
  172. font-size: 30px;
  173. }
  174. section>.section-box.news>.box-content{
  175. /* height: 420px; */
  176. }
  177. section>.section-box.pic-site>.box-content {
  178. /* height: 470px; */
  179. padding: 0;
  180. }
  181. section>.news>.box-content, section>.pic-site>.box-content {
  182. display: grid;
  183. grid-auto-flow: row;
  184. grid-template-columns: repeat(3, 1fr);
  185. grid-template-rows: 1fr;
  186. justify-items: stretch;
  187. align-items: stretch;
  188. padding: 30px 15px;
  189. column-gap: 20px;
  190. }
  191. section>.section-box.news>.box-content:hover
  192. , section>.section-box.secondhand-trade>.box-content:hover {
  193. box-shadow: 0 0 10px black;
  194. }
  195. section>.section-box.news>.box-content>.left{
  196. display:grid;
  197. grid-auto-flow: row;
  198. grid-template-columns: repeat(2, 1fr);
  199. grid-template-rows: repeat(2, 1fr);
  200. }
  201. section>.section-box.news>.box-content>.left>a {
  202. text-decoration: none;
  203. color: #333;
  204. }
  205. section>.section-box.news>.box-content>.left>a:first-of-type {
  206. grid-column-end: span 2;
  207. }
  208. section>.section-box.news>.box-content>.left>a>div{
  209. width: 100%;
  210. height: 95%;
  211. display: flex;
  212. flex-flow: column nowrap;
  213. justify-content: space-between;
  214. }
  215. section>.section-box.news>.box-content>.left>a img{
  216. width: inherit;
  217. }
  218. section>.section-box.news>.box-content>div:not(:first-of-type)>p>a{
  219. font-size: 23px;
  220. color: red;
  221. text-decoration: none;
  222. }
  223. section>.section-box.news>.box-content>div:not(:first-of-type)>ul:first-of-type {
  224. margin-bottom: 40px;
  225. }
  226. section>.section-box.news>.box-content>div:not(:first-of-type)>ul>li{
  227. /* margin: 10px 0; */
  228. height: 32px;
  229. line-height: 32px;
  230. }
  231. section>.section-box.news>.box-content>div:not(:first-of-type)>ul>li>span {
  232. color: #666;
  233. margin-right: 10px;
  234. }
  235. section>.section-box.news>.box-content>div:not(:first-of-type)>ul>li>a {
  236. text-decoration: none;
  237. color: #333;
  238. }
  239. section>.section-box.pic-site>.box-content>div{
  240. background-color: #fafafa;
  241. border-radius: 10px;
  242. /* height: 100%; */
  243. }
  244. section>.section-box.pic-site>.box-content>div:hover {
  245. box-shadow: 0 0 10px black;
  246. }
  247. section>.section-box.pic-site{
  248. height: 570px;
  249. }
  250. section>.section-box.pic-site>.box-content>div{
  251. padding: 20px 20px 0 20px;
  252. }
  253. section>.section-box.pic-site>.box-content .title{
  254. height: 50px;
  255. line-height: 30px;
  256. border-bottom: 1px solid #999;
  257. }
  258. section>.section-box.pic-site>.box-content .title>span {
  259. font-size: 30px;
  260. vertical-align: middle;
  261. color: #666;
  262. }
  263. section>.section-box.pic-site>.box-content .title>a {
  264. color: red;
  265. margin-left: 20px;
  266. text-decoration: none;
  267. }
  268. section>.section-box.pic-site>.box-content .pic-content{
  269. padding: 20px 0;
  270. display: grid;
  271. grid-template-columns: repeat(2, 1fr);
  272. grid-template-rows: repeat(2, 1fr);
  273. justify-content: space-between;
  274. gap: 20px;
  275. }
  276. section>.section-box.pic-site>.box-content .pic-content>.pic-box{
  277. max-width: 100%;
  278. }
  279. section>.section-box.pic-site>.box-content .pic-content>.pic-box>img{
  280. width: 100%;
  281. }
  282. section>.secondhand-trade {
  283. background-color: #fafafa;
  284. margin-bottom: 10px;
  285. }
  286. section>.secondhand-trade>.box-content {
  287. display: grid;
  288. grid-auto-flow: row;
  289. grid-template-columns: 2fr 1fr;
  290. grid-template-rows: 1fr;
  291. justify-items: stretch;
  292. align-items: stretch;
  293. padding: 20px 15px;
  294. column-gap: 20px;
  295. }
  296. section>.secondhand-trade>.box-content>.title{
  297. height: 50px;
  298. line-height: 30px;
  299. border-bottom: 1px solid #666;
  300. grid-column-end: span 2;
  301. }
  302. section>.secondhand-trade>.box-content>.title>span:first-of-type{
  303. font-size: 30px;
  304. color: #666;
  305. vertical-align: middle;
  306. }
  307. section>.secondhand-trade>.box-content>.title>span:last-of-type {
  308. margin-left: 20px;
  309. color:red;
  310. }
  311. section>.secondhand-trade>.box-content>.hot-cats {
  312. height: 70px;
  313. line-height: 30px;
  314. padding-top: 20px;
  315. grid-column-end: span 2;
  316. }
  317. section>.secondhand-trade>.box-content>.hot-cats>span{
  318. font-size: 30px;
  319. color: red;
  320. vertical-align: middle;
  321. }
  322. section>.secondhand-trade>.box-content>.hot-cats>a {
  323. margin-left: 20px;
  324. text-decoration: none;
  325. color: #666;
  326. }
  327. section>.secondhand-trade>.box-content>.girl-content{
  328. padding: 5px;
  329. display: grid;
  330. grid-template-columns: repeat(4, 1fr);
  331. grid-template-rows: repeat(2, 1fr);
  332. }
  333. section>.secondhand-trade>.box-content>.girl-content>.girl-box{
  334. padding: 5px;
  335. display: block;
  336. text-decoration: none;
  337. }
  338. section>.secondhand-trade>.box-content>.girl-content>.girl-box>img{
  339. width: 100%;
  340. border: 1px solid #aaa;
  341. border-radius: 10px;
  342. }
  343. section>.secondhand-trade>.box-content>.girl-content>.girl-box>p{
  344. color: #666;
  345. display: inline-block;
  346. margin-top: 10px;
  347. }
  348. section>.secondhand-trade>.box-content>.girl-content>.girl-box>div{
  349. display: flex;
  350. flex-flow: row nowrap;
  351. justify-content: space-between;
  352. margin-top: 10px;
  353. }
  354. section>.secondhand-trade>.box-content>.girl-content>.girl-box>div>span:first-of-type{
  355. color: red;
  356. }
  357. section>.secondhand-trade>.box-content>.girl-content>.girl-box>div>span:last-of-type{
  358. background-color:limegreen;
  359. color: #fff;
  360. padding: 0 5px;
  361. }
  362. section>.secondhand-trade>.box-content>.secondhand{
  363. display: grid;
  364. grid-template-columns: repeat(2, 1fr);
  365. grid-template-rows: repeat(3, 1fr);
  366. padding-top: 10px;
  367. gap: 10px
  368. }
  369. section>.secondhand-trade>.box-content>.secondhand>.secondhand-box {
  370. padding:5px;
  371. }
  372. section>.secondhand-trade>.box-content>.secondhand>.secondhand-box>img{
  373. width: 100%;
  374. }
  375. section>.secondhand-trade>.box-content>.secondhand>.seconhand-box-lg {
  376. grid-column-end: span 2;
  377. }
  378. section>.secondhand-trade>.box-content>.secondhand>.seconhand-box-lg img {
  379. width: 100%;
  380. }
  381. section>.friend-link{
  382. padding: 30px 30px 0 30px;
  383. display: grid;
  384. grid-auto-flow: row;
  385. grid-template-columns: repeat(auto-fill, 100px);
  386. row-gap: 20px;
  387. }
  388. section>.friend-link a {
  389. text-decoration: none;
  390. color: #666;
  391. }
  392. section>.friend-link a:hover{
  393. color: lightskyblue;
  394. }
  395. footer {
  396. background-color: black;
  397. color: #999;
  398. padding: 30px 30px;
  399. }
  400. footer>.footer-box{
  401. max-width: 1200px;
  402. margin: 0 auto;
  403. display: grid;
  404. grid-auto-flow: row;
  405. grid-template-columns: 2fr 1fr;
  406. grid-template-rows: 1fr;
  407. }
  408. footer>.footer-box>.left{
  409. display: grid;
  410. grid-template-columns: 25% 75%;
  411. grid-template-rows: 1fr;
  412. row-gap: 20px;
  413. border-right: 1px solid #999;
  414. }
  415. footer>.footer-box>.left>.footer-nav{
  416. grid-column-end: span 2;
  417. display: flex;
  418. flex-flow: row nowrap;
  419. justify-content: space-evenly;
  420. align-items: center;
  421. }
  422. footer>.footer-box>.left>.footer-nav>a {
  423. color: #999;
  424. text-decoration: none;
  425. }
  426. footer>.footer-box>.left>.banquanxinxi>p {
  427. padding: 10px 0;
  428. }
  429. </style>
  430. </head>
  431. <body>
  432. <header>
  433. <div class="left">
  434. <a href="">网站首页</a>
  435. <a href="">专题</a>
  436. <a href="">网站导航</a>
  437. <a href="">二手商品</a>
  438. <a href="">讨论区</a>
  439. </div>
  440. <div class="right">
  441. <a href="">
  442. <span class="iconfont icon-yonghu"></span>&nbsp;
  443. <span>登录</span>
  444. </a>
  445. <a href="">免费注册</a>
  446. </div>
  447. </header>
  448. <section>
  449. <div class="top">
  450. <div class="top-header">
  451. <img src="static/images/logo.png" alt="" class="logo">
  452. <div class="right">
  453. <input type="text" name="" id="">
  454. <span class="iconfont icon-icon--"></span>
  455. <a href=""><span class="iconfont icon-iconfontqz"></span></a>
  456. <a href=""><span class="iconfont icon-pinglun"></span></a>
  457. <a href=""><span class="iconfont icon-fasong"></span></a>
  458. <a href=""><span class="iconfont icon-icon--"></span></a>
  459. <a href=""><span class="iconfont icon-yonghu"></span></a>
  460. <a href=""><span class="iconfont icon-dianzan"></span></a>
  461. </div>
  462. </div>
  463. <div class="nav">
  464. <div class="nav-box">
  465. <span class="iconfont icon-wendang"></span>
  466. <a href="">资讯</a>
  467. <a href="">器材</a>
  468. <a href="">大师</a>
  469. <a href="">学院</a>
  470. <a href="">实战</a>
  471. <a href="">学习</a>
  472. <a href="">大赛</a>
  473. <a href="">裤子</a>
  474. <a href="">影视</a>
  475. <a href="">其他</a>
  476. </div>
  477. <div class="nav-box">
  478. <span class="iconfont icon-wendang"></span>
  479. <a href="">资讯</a>
  480. <a href="">器材</a>
  481. <a href="">大师</a>
  482. <a href="">学院</a>
  483. <a href="">实战</a>
  484. <a href="">学习</a>
  485. <a href="">大赛</a>
  486. <a href="">裤子</a>
  487. <a href="">影视</a>
  488. <a href="">其他</a>
  489. </div>
  490. <div class="nav-box">
  491. <span class="iconfont icon-wendang"></span>
  492. <a href="">资讯</a>
  493. <a href="">器材</a>
  494. <a href="">大师</a>
  495. <a href="">学院</a>
  496. <a href="">实战</a>
  497. <a href="">学习</a>
  498. <a href="">大赛</a>
  499. <a href="">裤子</a>
  500. <a href="">影视</a>
  501. <a href="">其他</a>
  502. </div>
  503. <div class="nav-box">
  504. <span class="iconfont icon-wendang"></span>
  505. <a href="">资讯</a>
  506. <a href="">器材</a>
  507. <a href="">大师</a>
  508. <a href="">学院</a>
  509. <a href="">实战</a>
  510. <a href="">学习</a>
  511. <a href="">大赛</a>
  512. <a href="">裤子</a>
  513. <a href="">影视</a>
  514. <a href="">其他</a>
  515. </div>
  516. </div>
  517. <div class="lunbo">
  518. <img src="static/images/lunbo1.jpg" alt="">
  519. <img src="static/images/lunbo2.jpg" alt="">
  520. </div>
  521. </div>
  522. </section>
  523. <section>
  524. <div class="section-box news">
  525. <div class="title"><span>行业资讯</span></div>
  526. <div class="box-content">
  527. <div class="left">
  528. <a href="">
  529. <img src="static/images/news1.jpg" alt="">
  530. </a>
  531. <a href="">
  532. <div>
  533. <img src="static/images/n-2.jpg" alt="">
  534. <p>三星Note10发布搭载挖孔前摄</p>
  535. </div>
  536. </a>
  537. <a href="">
  538. <div>
  539. <img src="static/images/n-3.jpg" alt="">
  540. <p>小米发布1亿像素手机信息</p>
  541. </div>
  542. </a>
  543. </div>
  544. <div class="center">
  545. <p>
  546. <a href="">大隐于市的摄影师,薇薇安·迈尔</a>
  547. </p>
  548. <ul>
  549. <li>
  550. <span>[新闻]</span>
  551. <a href="">佳能注册相机无线充电和眼控对焦专利</a>
  552. </li>
  553. <li>
  554. <span>[新闻]</span>
  555. <a href="">Entaniya宣布推出Super 35 PL卡口鱼眼镜头</a>
  556. </li>
  557. <li>
  558. <span>[新闻]</span>
  559. <a href="">轻便灵巧可变形 JOBY入门迷你三脚架套装试用</a>
  560. </li>
  561. <li>
  562. <span>[新闻]</span>
  563. <a href="">乐摄宝Photo Active BP 300 AW背包评测</a>
  564. </li>
  565. </ul>
  566. <ul>
  567. <li>
  568. <span>[新闻]</span>
  569. <a href="">佳能注册相机无线充电和眼控对焦专利</a>
  570. </li>
  571. <li>
  572. <span>[新闻]</span>
  573. <a href="">Entaniya宣布推出Super 35 PL卡口鱼眼镜头</a>
  574. </li>
  575. <li>
  576. <span>[新闻]</span>
  577. <a href="">轻便灵巧可变形 JOBY入门迷你三脚架套装试用</a>
  578. </li>
  579. <li>
  580. <span>[新闻]</span>
  581. <a href="">乐摄宝Photo Active BP 300 AW背包评测</a>
  582. </li>
  583. <li>
  584. <span>[新闻]</span>
  585. <a href="">乐摄宝Photo Active BP 300 AW背包评测</a>
  586. </li>
  587. </ul>
  588. </div>
  589. <div class="right">
  590. <p>
  591. <a href="">元旦春节,双节联动,备年货啦!!</a>
  592. </p>
  593. <ul>
  594. <li>
  595. <span>[促销]</span>
  596. <a href="">佳能 EOS RP 12899元起</a>
  597. </li>
  598. <li>
  599. <span>[促销]</span>
  600. <a href="">定焦,变焦, 新人小白如何选择?这三款值得买</a>
  601. </li>
  602. <li>
  603. <span>[促销]</span>
  604. <a href="">新一代入门神器? 佳能EOS 850D将到来</a>
  605. </li>
  606. <li>
  607. <span>[促销]</span>
  608. <a href="">无低通次旗舰 D7500套机6899元</a>
  609. </li>
  610. </ul>
  611. <ul>
  612. <li>
  613. <span>[促销]</span>
  614. <a href="">佳能注册相机无线充电和眼控对焦专利</a>
  615. </li>
  616. <li>
  617. <span>[促销]</span>
  618. <a href="">E复古全幅单反 尼康Df套机14500元</a>
  619. </li>
  620. <li>
  621. <span>[促销]</span>
  622. <a href="">索尼α7R IV超广套装售42698元</a>
  623. </li>
  624. <li>
  625. <span>[促销]</span>
  626. <a href="">RF大三元长焦 RF70-200mm售17699</a>
  627. </li>
  628. <li>
  629. <span>[促销]</span>
  630. <a href="">有所保留 佳能EOS-1D X III再曝新功能</a>
  631. </li>
  632. </ul>
  633. </div>
  634. </div>
  635. </div>
  636. <!-- </section>
  637. <section> -->
  638. <div class="section-box pic-site">
  639. <div class="title"><span>图片专区</span></div>
  640. <div class="box-content">
  641. <div class="left">
  642. <div class="title">
  643. <span>美女</span>
  644. <a href="">纵观摄影艺术</a>
  645. </div>
  646. <div class="pic-content">
  647. <div class="pic-box">
  648. <img src="static/images/img1.jpg" alt="">
  649. <p>阴沉夏日的柔美身姿 复古少女的藕荷色心情</p>
  650. </div>
  651. <div class="pic-box">
  652. <img src="static/images/img2.jpg" alt="">
  653. <p>愿你生活的都是每一天都是快快乐乐的, 一定要</p>
  654. </div>
  655. <div class="pic-box">
  656. <img src="static/images/img3.jpg" alt="">
  657. <p>今夜我不关心人类,我只想你,从爱上你的那天起</p>
  658. </div>
  659. <div class="pic-box">
  660. <img src="static/images/img4.jpg" alt="">
  661. <p>我转头,看见你走来,在阳光里,于是笑容从我心里溢出</p>
  662. </div>
  663. </div>
  664. </div>
  665. <div class="center">
  666. <div class="title">
  667. <span>健康</span>
  668. <a href="">纵观摄影艺术</a>
  669. </div>
  670. <div class="pic-content">
  671. <div class="pic-box">
  672. <img src="static/images/img1.jpg" alt="">
  673. <p>阴沉夏日的柔美身姿 复古少女的藕荷色心情</p>
  674. </div>
  675. <div class="pic-box">
  676. <img src="static/images/img2.jpg" alt="">
  677. <p>愿你生活的都是每一天都是快快乐乐的, 一定要</p>
  678. </div>
  679. <div class="pic-box">
  680. <img src="static/images/img3.jpg" alt="">
  681. <p>今夜我不关心人类,我只想你,从爱上你的那天起</p>
  682. </div>
  683. <div class="pic-box">
  684. <img src="static/images/img4.jpg" alt="">
  685. <p>我转头,看见你走来,在阳光里,于是笑容从我心里溢出</p>
  686. </div>
  687. </div>
  688. </div>
  689. <div class="right">
  690. <div class="title">
  691. <span>青春</span>
  692. <a href="">纵观摄影艺术</a>
  693. </div>
  694. <div class="pic-content">
  695. <div class="pic-box">
  696. <img src="static/images/img1.jpg" alt="">
  697. <p>阴沉夏日的柔美身姿 复古少女的藕荷色心情</p>
  698. </div>
  699. <div class="pic-box">
  700. <img src="static/images/img2.jpg" alt="">
  701. <p>愿你生活的都是每一天都是快快乐乐的, 一定要</p>
  702. </div>
  703. <div class="pic-box">
  704. <img src="static/images/img3.jpg" alt="">
  705. <p>今夜我不关心人类,我只想你,从爱上你的那天起</p>
  706. </div>
  707. <div class="pic-box">
  708. <img src="static/images/img4.jpg" alt="">
  709. <p>我转头,看见你走来,在阳光里,于是笑容从我心里溢出</p>
  710. </div>
  711. </div>
  712. </div>
  713. </div>
  714. </div>
  715. <div class="section-box secondhand-trade">
  716. <div class="title"><span>二手交易</span></div>
  717. <div class="box-content">
  718. <div class="title">
  719. <span>抢好货</span>
  720. <span href="">0低价, 便捷,安全,快速</span>
  721. </div>
  722. <div class="hot-cats">
  723. <span>热门分类</span>
  724. <a href="">美女写真</a>
  725. <a href="">日本美女</a>
  726. <a href="">美国美女</a>
  727. <a href="">国内美女</a>
  728. <a href="">AV美女</a>
  729. </div>
  730. <div class="girl-content">
  731. <a href="#" class="girl-box">
  732. <img src="static/images/shop1.jpg" alt="">
  733. <p>美女性感写真海报墙艺术装饰画贴画图1</p>
  734. <div>
  735. <span>¥345</span>
  736. <span>美女</span>
  737. </div>
  738. </a>
  739. <a href="#" class="girl-box">
  740. <img src="static/images/shop1.jpg" alt="">
  741. <p>美女性感写真海报墙艺术装饰画贴画图1</p>
  742. <div>
  743. <span>¥345</span>
  744. <span>美女</span>
  745. </div>
  746. </a>
  747. <a href="#" class="girl-box">
  748. <img src="static/images/shop1.jpg" alt="">
  749. <p>美女性感写真海报墙艺术装饰画贴画图1</p>
  750. <div>
  751. <span>¥345</span>
  752. <span>美女</span>
  753. </div>
  754. </a>
  755. <a href="#" class="girl-box">
  756. <img src="static/images/shop1.jpg" alt="">
  757. <p>美女性感写真海报墙艺术装饰画贴画图1</p>
  758. <div>
  759. <span>¥345</span>
  760. <span>美女</span>
  761. </div>
  762. </a>
  763. <a href="#" class="girl-box">
  764. <img src="static/images/shop1.jpg" alt="">
  765. <p>美女性感写真海报墙艺术装饰画贴画图1</p>
  766. <div>
  767. <span>¥345</span>
  768. <span>美女</span>
  769. </div>
  770. </a>
  771. <a href="#" class="girl-box">
  772. <img src="static/images/shop1.jpg" alt="">
  773. <p>美女性感写真海报墙艺术装饰画贴画图1</p>
  774. <div>
  775. <span>¥345</span>
  776. <span>美女</span>
  777. </div>
  778. </a>
  779. <a href="#" class="girl-box">
  780. <img src="static/images/shop1.jpg" alt="">
  781. <p>美女性感写真海报墙艺术装饰画贴画图1</p>
  782. <div>
  783. <span>¥345</span>
  784. <span>美女</span>
  785. </div>
  786. </a>
  787. <a href="#" class="girl-box">
  788. <img src="static/images/shop1.jpg" alt="">
  789. <p>美女性感写真海报墙艺术装饰画贴画图1</p>
  790. <div>
  791. <span>¥345</span>
  792. <span>美女</span>
  793. </div>
  794. </a>
  795. </div>
  796. <div class="secondhand">
  797. <div class="seconhand-box">
  798. <a href="">
  799. <img src="static/images/sh1.png" alt="">
  800. </a>
  801. </div>
  802. <div class="seconhand-box">
  803. <a href="">
  804. <img src="static/images/sh2.png" alt="">
  805. </a>
  806. </div>
  807. <div class="seconhand-box">
  808. <a href="">
  809. <img src="static/images/sh3.png" alt="">
  810. </a>
  811. </div>
  812. <div class="seconhand-box">
  813. <a href="">
  814. <img src="static/images/sh4.png" alt="">
  815. </a>
  816. </div>
  817. <div class="seconhand-box-lg">
  818. <a href="">
  819. <img src="static/images/sh5.png" alt="">
  820. </a>
  821. <a href="">
  822. <img src="static/images/sh6.jpg" alt="">
  823. </a>
  824. </div>
  825. </div>
  826. </div>
  827. </div>
  828. <div class="section-box secondhand-trade">
  829. <div class="title"><span>合作单位</span></div>
  830. </div>
  831. </section>
  832. <section>
  833. <div class="section-box friend-link">
  834. <a href="">友情链接1</a>
  835. <a href="">友情链接2</a>
  836. <a href="">友情链接3</a>
  837. <a href="">友情链接4</a>
  838. <a href="">友情链接5</a>
  839. <a href="">友情链接6</a>
  840. <a href="">友情链接7</a>
  841. <a href="">友情链接8</a>
  842. <a href="">友情链接9</a>
  843. <a href="">友情链接10</a>
  844. <a href="">友情链接11</a>
  845. <a href="">友情链接12</a>
  846. <a href="">友情链接13</a>
  847. <a href="">友情链接14</a>
  848. <a href="">友情链接15</a>
  849. <a href="">友情链接16</a>
  850. <a href="">友情链接17</a>
  851. <a href="">友情链接18</a>
  852. <a href="">友情链接19</a>
  853. <a href="">友情链接20</a>
  854. </div>
  855. </section>
  856. <footer>
  857. <div class="footer-box">
  858. <div class="left">
  859. <div class="footer-nav">
  860. <a href="">简介</a>
  861. <a href="">联系我们</a>
  862. <a href="">招聘信息</a>
  863. <a href="">友情链接</a>
  864. <a href="">用户服务协议</a>
  865. <a href="">隐私声明</a>
  866. <a href="">法律投诉声明</a>
  867. </div>
  868. <div class="logo">
  869. <img src="" alt="">
  870. </div>
  871. <div class="banquanxinxi">
  872. <p>2019 fengniao.com. All rights reserved . 安徽闹着玩有限公司(无聊网)版权所有</p>
  873. <p>皖ICP证150110号 京ICP备14323013号-2 皖公网安备110108024357788号</p>
  874. <p>违法和不良信息举报电话: 0551-1234567 举报邮箱: admin@baidu.com</p>
  875. </div>
  876. </div>
  877. <div class="right"></div>
  878. </div>
  879. </footer>
  880. </body>
  881. </html>

运行效果:

学习心得

  • grid和flex让布局变得简单, 而且学习起来也比较容易理解. 但是到了实战, 总体感觉是自己学会了, 但是却写不出来. 或者一个简单的实现, 需要写很多样式代码才能实现, 有些对齐方式还要靠猜, 说到底应该还是写得少.
  • 仿站实战, 感觉还是老问题, css代码太乱, 还没有学会怎样规划样式. 有点像面向过程编码, 样式复用率低. 需要找时间把老师的实战代码通读理解, 主要是学习老师的实现方式和样式规划思想. 如果老师能解读一下就更好了.
  • 上班狗, 前端的作业除”0408的盒模型浮动定位”还没写, 其他的都补完了, 挺有成就感的.
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议