replace ascii box-model with diagram, expand explanation

This commit is contained in:
2026-04-20 10:59:00 +02:00
parent fb361a2854
commit b3c0994b7e
3 changed files with 64 additions and 15 deletions

View File

@@ -0,0 +1,53 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>Box-Modell Diagramm</title>
<style>
html, body { margin: 0; padding: 0; background: #fff; font-family: system-ui, sans-serif; }
body { padding: 40px; display: inline-block; box-sizing: border-box; }
.layer {
padding-top: 38px;
padding-bottom: 30px;
padding-left: 30px;
padding-right: 30px;
position: relative;
border-radius: 4px;
}
.layer::before {
position: absolute;
top: 8px; left: 14px;
font-size: 0.95rem;
font-weight: 700;
letter-spacing: 0.02em;
}
.margin { background: #fde68a; }
.margin::before { content: "margin"; color: #92400e; }
.border { background: #fca5a5; }
.border::before { content: "border"; color: #991b1b; }
.padding { background: #86efac; }
.padding::before { content: "padding"; color: #166534; }
.content {
background: #93c5fd;
width: 260px;
height: 110px;
display: flex;
align-items: center;
justify-content: center;
color: #1e3a8a;
font-weight: 700;
font-size: 1.2rem;
border-radius: 4px;
}
</style>
</head>
<body>
<div class="layer margin">
<div class="layer border">
<div class="layer padding">
<div class="content">content</div>
</div>
</div>
</div>
</body>
</html>