📜  CSS 网格列 - CSS 代码示例

📅  最后修改于: 2022-03-11 14:47:52.247000             🧑  作者: Mango

代码示例4
.hero {
  /* Photo by mnm.all on Unsplash */
  background: url('https://images.unsplash.com/photo-1518176258769-f227c798150e') center;
  background-size: cover;
  padding: 4rem 2rem;

  /* Grid styles */
  display: grid;
  align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}