Files
uni/slides/223015c/assets/demos/dom-tree.html

56 lines
2.1 KiB
HTML

<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>DOM-Baum</title>
<style>
html, body { margin: 0; padding: 0; background: #fff; font-family: system-ui, sans-serif; }
body { padding: 30px; display: inline-block; }
.tree { display: flex; flex-direction: column; align-items: center; }
.node {
background: #dbeafe;
border: 2px solid #1e40af;
color: #1e3a8a;
padding: 7px 16px;
border-radius: 6px;
font-family: ui-monospace, monospace;
font-weight: 700;
font-size: 0.9rem;
}
.root { background: #e0e7ff; border-color: #4f46e5; color: #3730a3; }
.content { background: #dcfce7; border-color: #15803d; color: #14532d; font-weight: 400; font-style: italic; }
.level { display: flex; gap: 28px; margin-top: 10px; align-items: flex-start; }
.col { display: flex; flex-direction: column; align-items: center; }
</style>
</head>
<body>
<div class="tree">
<div class="node root">document</div>
<svg width="200" height="24"><line x1="100" y1="0" x2="100" y2="24" stroke="#d63384" stroke-width="2"/></svg>
<div class="node root">&lt;html&gt;</div>
<svg width="380" height="26">
<line x1="190" y1="0" x2="90" y2="26" stroke="#d63384" stroke-width="2"/>
<line x1="190" y1="0" x2="290" y2="26" stroke="#d63384" stroke-width="2"/>
</svg>
<div class="level">
<div class="col">
<div class="node">&lt;head&gt;</div>
<svg width="120" height="22"><line x1="60" y1="0" x2="60" y2="22" stroke="#d63384" stroke-width="2"/></svg>
<div class="node">&lt;title&gt;</div>
</div>
<div class="col">
<div class="node">&lt;body&gt;</div>
<svg width="220" height="26">
<line x1="110" y1="0" x2="55" y2="26" stroke="#d63384" stroke-width="2"/>
<line x1="110" y1="0" x2="165" y2="26" stroke="#d63384" stroke-width="2"/>
</svg>
<div class="level">
<div class="node">&lt;h1&gt;</div>
<div class="node">&lt;p&gt;</div>
</div>
</div>
</div>
</div>
</body>
</html>