示例工程 09-display-normal-flow

09-display-normal-flow/demo-01-block-inline/style.css

css · 0.7 KB

运行:block、inline 与 inline-block

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

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

h1 {
  margin: 0 0 8px;
  font-size: 26px;
}

h2 {
  margin: 18px 0 6px;
  font-size: 15px;
  color: #64748b;
}

.block {
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e40af;
}

.inline {
  width: 200px;
  height: 80px;
  padding: 6px 10px;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  background: #fffbeb;
  color: #92400e;
}

.inline-block {
  display: inline-block;
  width: 150px;
  height: 56px;
  padding: 6px 10px;
  border: 1px solid #16a34a;
  border-radius: 8px;
  background: #f0fdf4;
  color: #166534;
}