Beispiel:Bilder präsentieren-3a.html
Aus SELFHTML-Wiki
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" media="screen" href="./Beispiel:SELFHTML-Beispiel-Grundlayout.css" >
<title>Bildunterschriften mit figcaption präsentieren</title>
<style>
figure, figcaption {
margin: 0;
padding: 0;
}
#gallery {
width: 40em;
border: thin dotted;
figure {
display: grid;
grid-template-columns: 1fr 1fr;
align-items: center;
gap: 1em;
max-width: 600px;
}
img {
height: auto;
margin-bottom: 1em;
}
figcaption {
background: grey;
color: white;
}
}
</style>
</head>
<body>
<h1>Bildunterschriften mit figcaption präsentieren</h1>
<figure id="gallery">
<figcaption>Ansichten von Lauf an der Pegnitz</figcaption>
<figure>
<img src="//wiki.selfhtml.org/images/a/a6/Lauf-1.jpg" alt="Lauf an der Pegnitz - Nürnberger Tor">
<figcaption>Nürnberger Tor</figcaption>
</figure>
<figure>
<img src="//wiki.selfhtml.org/images/4/4a/Lauf-2.jpg" alt="Lauf an der Pegnitz - Pegnitz">
<figcaption>Brücke über die Pegnitz</figcaption>
</figure>
<figure>
<img src="//wiki.selfhtml.org/images/2/24/Lauf-3.jpg" alt="Lauf an der Pegnitz - Nürnberger Tor">
<figcaption>Mauermühle und Judenturm</figcaption>
</figure>
</figure>
</body>
</html>