Blogger Information
Blog 56
fans 0
comment 4
visits 37845
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
Gird布局实战(圣杯布局)
异乡客
Original
704 people have browsed it

  1. <!DOCTYPE html>
  2. <html lang="en">
  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>Gird布局实战(圣杯布局)</title>
  8. </head>
  9. <body>
  10. <header>页眉</header>
  11. <aside>左侧</aside>
  12. <main>主体</main>
  13. <aside>右侧</aside>
  14. <footer>页脚</footer>
  15. <style>
  16. *{
  17. padding:0;
  18. margin:0;
  19. box-sizing: border-box;
  20. }
  21. body *{
  22. background-color: lightgreen;
  23. }
  24. body {
  25. display: grid;
  26. /* 3行3列 */
  27. /* minmax(400px,1fr) 中间响应式,两边固定 */
  28. grid-template-columns: 200px minmax(400px,1fr) 200px;
  29. /* minmax(clac(100vh - 6em - 0.6em),1fr) */
  30. grid-template-rows: 3em minmax(calc(100vh - 6em - 0.6em),1fr) 3em;
  31. gap: 0.3em;
  32. place-content: center;
  33. }
  34. header,
  35. footer{
  36. grid-column: span 3;
  37. }
  38. </style>
  39. </body>
  40. </html>
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