CSS实现透明网格底图风格

更新于 2024-01-06 11:28 151
专栏: 前端文章 标签: css

实现代码

  1. .transparent-grid {
  2. background-image: linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%),
  3. linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%);
  4. background-size: 16px 16px;
  5. background-position: 0 0, 8px 8px;
  6. background-color: #e2e8f0;
  7. }

实现效果