DIV.Kategorie {
width: 80%;
height: .8em;
line-height: 1em;
border-bottom: 4px dotted slategray;
margin-top: .9em;
font-size: 1em;
font-weight: bold;
}
DIV.Unterkategorie {
width: 81%;
margin-left: 6%;
height: 1.1em;
border-bottom: 2px dotted slategray;
margin-top: .4em;
font-size: .8em;
font-weight: bold;
}
.Textelement {
float: left;
position: relative;
top: 5px;
background-color: white;
border-bottom: solid white .2em;
margin-bottom: -.3em;
text-align: left;
padding-right: 10px;
}
.Seitenzahl {
float: right;
position: relative;
top: 5px;
background-color: white;
border-bottom: solid white .2em;
margin-bottom: -.4em;
text-align: right;
width: 44px;
}
<html>
<head>
<title>Inhaltsverzeichnisse mit CSS erstellen</title>
</head>
<body>
<div class="Kategorie">
<div class="Textelement">Kapitel 1</div>
<div class="Seitenzahl">1</div>
</div>
<div class="Unterkategorie">
<div class="Textelement">Kapitel 1, Thema 1</div>
<div class="Seitenzahl">4</div>
</div>
<div class="Unterkategorie">
<div class="Textelement">Kapitel 1, Thema 2</div>
<div class="Seitenzahl">13</div>
</div>
<div class="Kategorie">
<div class="Textelement">Kapitel 2</div>
<div class="Seitenzahl">24</div>
</div>
</body>
</html>
| Weitere Artikel: |
|---|