display: grid布局

2022-08-29  本文已影响0人  royluck
.footer-container {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  color: var(--white);
}

@media only screen and (max-width: 998px) and (min-width: 768px){
  .footer-container {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 2rem;
    .footer-center:last-child{
      /* 列合并 */
      grid-column: 1 / span 2;
    }

  }
}

@media only screen and (max-width: 768px) {
  .footer-container {
    grid-template-columns: 1fr;
    row-gap: 2rem;
  }
}
image.png @media only screen and (max-width: 998px) and (min-width: 768px) @media only screen and (max-width: 768px)
上一篇下一篇

猜你喜欢

热点阅读