示例工程 43-subgrid

43-subgrid/demo-02-columns/style.css

css · 0.7 KB

运行:列子网格

点击「运行示例」后,左侧显示源码、右侧显示运行结果;console 输出会实时回传。

body {
  margin: 0;
  padding: 32px;
  background: #f8fafc;
  color: #0f172a;
  font-family: system-ui, sans-serif;
  line-height: 1.7;
}

h1 { margin: 0 0 4px; font-size: 26px; }
p { margin: 0; color: #64748b; font-size: 14px; }

.form {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 12px 16px;
  max-width: 520px;
  margin-top: 20px;
}

.row {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: center;
}

.row label { color: #64748b; font-size: 13px; }

.row input {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  font: inherit;
  font-size: 13px;
}