Beispiel:CSS-Ausrichtung-3.html

Aus SELFHTML-Wiki
Wechseln zu: Navigation, Suche
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" type="text/css" media="screen" href="./Beispiel:SELFHTML-Beispiel-Grundlayout.css" />
  <title>mehrere Bilder mit figure und display: inline-block</title>
  <style>
    figure, figcaption {
      margin: 0;
      padding: 0;
    }
 
    figure {
      display: inline-block;
    }
 
    figure img {
      width: 225px;
    }
 
    .oben {
      vertical-align: top;
     }
  </style>
</head>
 
<body>
  <h1>Bilder mit display: inline-block; ausrichten</h1>
  <main>
    <figure>
      <img src="http://wiki.selfhtml.org/images/e/e9/Lauf-1-hoch.jpg" alt="Lauf an der Pegnitz - Nürnberger Tor">
      <figcaption>
        Lauf an der Pegnitz<br> 
        Nürnberger Tor
      </figcaption>
    </figure>
    <figure>
      <img src="http://wiki.selfhtml.org/images/4/4a/Lauf-2.jpg" alt="Lauf an der Pegnitz - Pegnitz">
      <figcaption>
        Lauf an der Pegnitz<br>
        Brücke über die Pegnitz
      </figcaption>
    </figure>    
    <figure>
      <img src="http://wiki.selfhtml.org/images/2/24/Lauf-3.jpg" alt="Lauf an der Pegnitz - Nürnberger Tor">
      <figcaption>
         Lauf an der Pegnitz<br>
         Mauermühle und Judenturm
      </figcaption>
    </figure>
 
    <h2>oben ausgerichtet</h2>
    <figure class="oben">
      <img src="http://wiki.selfhtml.org/images/e/e9/Lauf-1-hoch.jpg" alt="Lauf an der Pegnitz - Nürnberger Tor">
      <figcaption>
        Lauf an der Pegnitz<br> 
        Nürnberger Tor
      </figcaption>
    </figure>
    <figure class="oben">
      <img src="http://wiki.selfhtml.org/images/4/4a/Lauf-2.jpg" alt="Lauf an der Pegnitz - Pegnitz">
      <figcaption>
        Lauf an der Pegnitz<br>
        Brücke über die Pegnitz
      </figcaption>
    </figure>    
    <figure class="oben">
      <img src="http://wiki.selfhtml.org/images/2/24/Lauf-3.jpg" alt="Lauf an der Pegnitz - Nürnberger Tor">
      <figcaption>
         Lauf an der Pegnitz<br>
         Mauermühle und Judenturm
      </figcaption>
    </figure>
  </main>
</body>
</html>