示例工程 04-cascade-specificity-inheritance

04-cascade-specificity-inheritance/demo-02-inheritance/style.css

css · 0.6 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 8px;
  font-size: 28px;
}

.parent {
  margin-top: 14px;
  padding: 16px;
  border: 2px solid #7c3aed;
  border-radius: 10px;
  background: #f5f3ff;
  color: #5b21b6;
  font-family: Georgia, "Times New Roman", serif;
}

.child {
  display: block;
  margin-top: 8px;
}

.own-border {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 8px;
  border: 2px solid #0f172a;
  border-radius: 6px;
  font-family: ui-monospace, monospace;
  font-size: 13px;
}