body {
    background-color: floralwhite;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  }
  
body > a{
    position: absolute;
    left: -500px
}
  
body > a:hover{
    left:0
}
  
header {
    background-color: lightgray;
}
  
nav{
    font-family:'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}
  
main{
    background-color: yellow;
    font-size: 20px;
}
footer {
    background-color: lightgray;
}
  
h1 {
    text-align: center;
    font-family: Cursive;
    color: darkblue;
}
  
  
nav ul {
    display: flex;
    flex-direction: column;
    list-style-type: none;
    font-size: 150%;
    border:2px solid black;
}
  
nav ul li{
    margin:15px 15px 15px -25px;
    padding: 15px;
    background-color: antiquewhite;
  
}
  
.grid {
    display: grid;
    grid-template-columns: 95%;
    justify-content: space-evenly;
    row-gap: 10px;
}
  
.grid img {
    width: 100%;
}
  

@media screen and (min-width:772px){
    .grid{
        grid-template-columns: 45% 45%;
        /*justify-items属性设置单元格内容的水平位置（左中右）
        align-items属性设置单元格内容的垂直位置（上中下）。
        place-items: <align-items> <justify-items>;
        */
        align-items: center;
    }
}
  
@media screen and (min-width:950px){
    /*set every 3rd image takes two columns*/
    .grid img:nth-child(3n){
        /*grid-column: <start-line> / <end-line>;
          grid-row: <start-line> / <end-line>;*/
        /*start from 1st, span 2 columns*/
        grid-column: 1 / span 2;
    }
}

@media screen and (min-width:1100px){
    .grid{
        grid-template-columns: 1fr 1fr 1fr; /*fr=fraction */
        align-items: stretch;
    }
    .grid img:nth-child(3n){
        /*clear the grid column setting before*/
        grid-column: auto;
    }
}

/*CSS Grid 网格布局教程
https://www.ruanyifeng.com/blog/2019/03/grid-layout-tutorial.html
*/

@media screen and (min-width:800px){
  nav ul {
    flex-direction: row;
    justify-content:space-around;
  
}