Blogger Information
Blog 145
fans 7
comment 7
visits 164441
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
12月29日练习:php中文网footer案例(组件footer)
李东亚¹⁸⁰³⁹⁵⁴⁰¹²⁰
Original
1023 people have browsed it

练习一:
php中文网public_footer组件:
1、html代码:

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <link rel="stylesheet" href="public_footer.css">
  6. <title>Title</title>
  7. </head>
  8. <body>
  9. <div class="public-footer">
  10. <div class="nav">
  11. <a href=""><span>链接1</span></a>
  12. <a href=""><span>链接2</span></a>
  13. <a href=""><span>链接3</span></a>
  14. <a href=""><span>链接4</span></a>
  15. <a href=""><span>链接5</span></a>
  16. <a href=""><span>链接6</span></a>
  17. <a href=""><span>链接7</span></a>
  18. </div>
  19. <div class="logo">
  20. <a href=""><img src="../../../images/logo.png" alt=""></a>
  21. </div>
  22. <div class="info">
  23. <p>2019 fengniao.com. All rights reserved . 安徽闹着玩(无聊网)版权所有</p>
  24. <p>皖ICP证150110号 京ICP备14323013号-2 皖公网安备110108024357788号</p>
  25. <p>违法和不良信息举报电话: 0551-1234567 举报邮箱: admin@baidu.com</p>
  26. </div>
  27. <div>
  28. <p>关注公众号</p>
  29. <img src="../../../static/images/erwei-code.png" alt="">
  30. </div>
  31. </div>
  32. </body>
  33. </html>

2、css代码:

  1. @import url(../../public_reset.css);
  2. .public-footer {
  3. min-width: 800px;
  4. max-width: 1200px;
  5. height: 200px;
  6. margin: 0 auto;
  7. outline:1px dashed red;
  8. color:#ffffff;
  9. background-color: #404040;
  10. display: grid;
  11. grid-template-columns: 1.5fr 4.5fr 4fr;
  12. grid-tempalte-rows: 2fr 8fr;
  13. }
  14. .public-footer > .nav {
  15. grid-column:1/3;
  16. margin-left: 30px;
  17. align-self: center;
  18. }
  19. .public-footer > .nav > a {
  20. margin-left:20px ;
  21. color:#ffffff;
  22. }
  23. .public-footer > .logo {
  24. grid-row:2/3;
  25. margin-top: 21px;
  26. /*align-self: end;*/
  27. justify-self: end;
  28. }
  29. .public-footer > .logo img {
  30. width: 140px;
  31. height: 60px;
  32. }
  33. .public-footer > .info {
  34. grid-column: 2/3;
  35. grid-row:2/3;
  36. justify-self: center;
  37. }
  38. .public-footer > .info > p {
  39. margin-top: 15px;
  40. }
  41. .public-footer > :last-child {
  42. grid-column: 3/4;
  43. grid-row:1/3;
  44. align-self: center;
  45. margin-left: 20px;
  46. }
  47. .public-footer > :last-child > p {
  48. margin-left: 24px;
  49. }
  50. .public-footer > :last-child > img {
  51. width: 120px;
  52. margin-top: 10px;
  53. }

3、效果图:在火狐浏览器中打开网格线

总结:
1、补充网格线定位练习;从1开始,整数递增,反向 从-1开始 负数递减
(1)划网格线:grid-template-columns/rows:
属性值:px; fr; 函数:repeat(1,1fr)——(1:重复次数,重复内容),minmax(100px,150px)伸缩空间
(2)网格线定位:grid-row/column-strat/end:1;
简写:grid-row/column: start/end ; (start网格定位起点线-end定位终止线)
2、网格中单元格对齐方法:是否旨在有空隙的时候有作用?
3、单元格内容对其:grid容器属性和项目属性易混淆:
容器属性:
(1)align/justify(水平垂直)-items/content(内容、单元格):
属性值:start center end;
(2)简写:place-items/content(内容/单元格):align justify;
项目属性:align/justify-self:
属性值:start center end :
4、网格间隙很少用:
(1)grid-column/row-gap: 属性值:px;
(2) 简写grid-gap: row column /gap

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