• [CSS] Get up and running with CSS Grid Layout


    We’ll discuss the display values pertinent to CSS Grid Layout – gridinline-grid, and subgrid. Then, let’s jump in at the deep end by putting together a simple grid layout in a flash.

    <!DOCTYPE html>
    <html>
    <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width">
      <title>JS Bin</title>
    </head>
    <body>
    <div class="container">
      <header>Header</header>
      <aside>Aside 1</aside>
      <section>Section</section>
      <aside>Aside 2</aside>
      <footer>Footer</footer>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.2/normalize.min.css" rel="stylesheet" type="text/css" />
    </div>
    </body>
    </html>
    .container {
      display: grid;
      grid-gap: 5px;
      grid-template-areas:
        "header"
        "section"
        "aside-1"
        "aside-2"
        "footer";
    }
    
    @media (min- 700px) {
      .container {
        grid-template-areas:
          "header header header"
          "aside-1 section aside-2"
          "footer footer footer";
      }
    }
    
    /* All Grid Items */
    .container > * {
      background-color: mediumseagreen;
      font-size: 80px;
    }
    
    header {
      grid-area: header;
    }
    
    aside:nth-of-type(1) {
      grid-area: aside-1;
    }
    
    section {
      grid-area: section;
    }
    
    aside:nth-of-type(2) {
      grid-area: aside-2;
    }
    
    footer {
      grid-area: footer;
    }
  • 相关阅读:
    2020-08-20
    2020-08-19
    2020-08-14
    2020-08-13
    使用numpy实现机器学习模型
    分治法学习
    2020-08-09
    2020-08-02
    四月是你的谎言下载
    新博客
  • 原文地址:https://www.cnblogs.com/Answer1215/p/6393985.html
Copyright © 2020-2023  润新知