Blogger Information
Blog 8
fans 0
comment 1
visits 5007
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
HTML grid布局
BARRY
Original
571 people have browsed it

grid布局企业站

  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>grid布局</title>
  7. <style>
  8. * {
  9. padding: 0;
  10. margin: 0;
  11. box-sizing: border-box;
  12. }
  13. body {
  14. display: flex;
  15. justify-content: center;
  16. align-items: center;
  17. min-height: 100vh;
  18. min-width: 100vh;
  19. }
  20. .container {
  21. min-width: 1000px;
  22. display: grid;
  23. gap: 20px;
  24. }
  25. .container > .row {
  26. display: grid;
  27. grid-template-columns: repeat(12, 1fr);
  28. min-height: 20px;
  29. }
  30. .container > .row > .item {
  31. padding: 10px;
  32. }
  33. .header {
  34. background-color: lightgray;
  35. grid-column: span 1;
  36. text-align: center;
  37. }
  38. .left {
  39. grid-column: 1/4;
  40. height: 400px;
  41. }
  42. .main {
  43. grid-column: 4/10;
  44. height: 500px;
  45. }
  46. .right {
  47. grid-column: 10/13;
  48. height: 400px;
  49. }
  50. .footer {
  51. grid-column: span 2;
  52. text-align: center;
  53. }
  54. .copyright {
  55. grid-column: span 12;
  56. text-align: center;
  57. }
  58. </style>
  59. </head>
  60. <body>
  61. <div class="container">
  62. <!-- 导航 -->
  63. <div class="row">
  64. <div class="item header">首页</div>
  65. <div class="item header">宏观</div>
  66. <div class="item header">财经</div>
  67. <div class="item header">行业</div>
  68. <div class="item header">数字经济</div>
  69. <div class="item header">招商</div>
  70. <div class="item header">营销</div>
  71. <div class="item header">园区</div>
  72. <div class="item header">特别策划</div>
  73. <div class="item header">综合</div>
  74. <div class="item header">区域</div>
  75. <div class="item header">客服</div>
  76. </div>
  77. <!-- 主体 -->
  78. <div class="row">
  79. <div class="item left"><img src="timg.jpg" alt="" width="300px" /></div>
  80. <div class="item main">
  81.  近日,国新办举行《关于全面提升“获得电力”服务水平持续优化用电营商环境的意见》国务院政策例行吹风会。国家能源局副局长刘宝华表示,在各地政府和电力企业特别是电网企业的共同努力下,“获得电力”工作已经取得积极成效,但各地“获得电力”服务水平还存在一些不平衡,有些地方营商环境还有一定差距。未来,能源局还将会同国务院有关部门、地方政府、电网企业抓好各项举措的落实落地,持续加大监管力度,督促各地按质保量完成任务,确保各项工作取得实效,力争把办电服务打造成国内营商环境品牌、树立为全球第一流标杆。
  82.   刘宝华指出,按照党中央、国务院优化营商环境的相关部署,国家能源局与相关部委、地方政府和电力企业一起,以世行营商环境评价为契机,以北京、上海为样本城市,对标国际先进水平,聚焦小微企业,全面开展“获得电力”便利化改革,推动我国营商环境持续改善。市场主体和人民群众办电用电的获得感、满意度明显提升,效果不错。
  83. </div>
  84. <div class="item right">
  85. <img src="timg2.jpg" alt="" width="300px" />
  86. </div>
  87. </div>
  88. <!-- 底部 -->
  89. <div class="row">
  90. <div class="item footer">员工专区</div>
  91. <div class="item footer">网站地图</div>
  92. <div class="item footer">联系方式</div>
  93. <div class="item footer">内审平台</div>
  94. <div class="item footer">招聘</div>
  95. </div>
  96. <div class="row">
  97. <div class="item copyright">
  98. 版权所有&copy;苏cc 8888-9999。| 地址:江苏省苏州市金枫路888号
  99. </div>
  100. </div>
  101. </div>
  102. </body>
  103. </html>

运行结果


grid网格相册

  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. <meta http-equiv="X-UA-Compatible" content="ie=edge" />
  7. <link rel="stylesheet" href="css/grid-picture.css" media="screen" />
  8. <title>摩托图片展示</title>
  9. <style>
  10. body {
  11. background-color: royalblue;
  12. }
  13. .container {
  14. display: grid;
  15. grid-gap: 10px;
  16. grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  17. grid-template-rows: repeat(300px);
  18. }
  19. .pic {
  20. border-radius: 10px;
  21. padding: 10px;
  22. background-color: #eee;
  23. display: flex;
  24. flex-flow: column nowrap;
  25. align-items: center;
  26. justify-self: center;
  27. }
  28. img {
  29. height: 200px;
  30. width: 300px;
  31. }
  32. h2 {
  33. text-align: center;
  34. font-size: 2.5rem;
  35. font-weight: normal;
  36. text-shadow: 2px 2px 2px #555;
  37. margin-top: 20px;
  38. }
  39. </style>
  40. </head>
  41. <body>
  42. <h2>摩托车图片展示</h2>
  43. <div class="container">
  44. <div class="pic">
  45. <img src="bt.jpg" alt="本田" />
  46. <p>本田</p>
  47. </div>
  48. <div class="pic">
  49. <img src="lm.jpg" alt="" />
  50. <p>铃木</p>
  51. </div>
  52. <div class="pic">
  53. <img src="ymh.jpg" alt="" />
  54. <p>雅马哈</p>
  55. </div>
  56. <div class="pic">
  57. <img src="cq.jpg" alt="" />
  58. <p>川崎</p>
  59. </div>
  60. <div class="pic">
  61. <img src="cf.jpg" alt="" />
  62. <p>春风</p>
  63. </div>
  64. <div class="pic">
  65. <img src="df.jpg" alt="" />
  66. <p>刀锋</p>
  67. </div>
  68. <div class="pic">
  69. <img src="tz.jpg" alt="" />
  70. <p>太子</p>
  71. </div>
  72. <div class="pic">
  73. <img src="hj.jpg" alt="" />
  74. <p>豪爵</p>
  75. </div>
  76. </div>
  77. </body>
  78. </html>

运行结果

Correcting teacher:天蓬老师天蓬老师

Correction status:qualified

Teacher's comments:以后, 注意作业中, 只需要提交关键代码, css不用交
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