JSFiddle - React, Tailwind, and code Playground
by fiedler
HTML
<header>
<img class="linkesbild" src="https://upload.wikimedia.org/wikipedia/commons/d/d4/Waldschaeden_Erzgebirge_2.jpg" alt="Waldschaden Dank an Wikipedia">
<p class="linkertext">Text1</p>
<img class="innenbild" src="https://upload.wikimedia.org/wikipedia/commons/d/d4/Waldschaeden_Erzgebirge_2.jpg" alt="Waldschaden Dank an Wikipedia">
<p class="rechtertext">Text2</p>
<img class="rechtesbild" src="https://upload.wikimedia.org/wikipedia/commons/d/d4/Waldschaeden_Erzgebirge_2.jpg" alt="Waldschaden Dank an Wikipedia">
</header>
CSS
header p {
margin: 0;
text-align: center;
font-size: 1.5rem;
}
header {
display: grid;
grid-template-columns: 1fr auto 1fr;
align-items: center;
gap: 0.5em;
}
header .innenbild {
display: inline-block;
}
header .linkesbild, header .rechtesbild {
display: none;
}
header p.linkertext {
text-align: right;
}
header p.rechtertext {
text-align: left;
}
img {
width: 60px;
max-width: 100%;
}
@media (min-width: 800px) {
header {
grid-template-columns: auto auto auto auto;
text-align: unset;
}
header .innenbild {
display: none;
}
header .linkesbild, header .rechtesbild {
display: inline-block;
}
header .linkesbild {
justify-self: end;
}
header .rechtesbild {
justify-self: baseline;
}
header p.linkertext {
justify-self: center;
}
header p.rechtertext {
justify-self: center;
}
}
/*******
align-items: stretch;
align-self: stretch;
justify-items: stretch;
justify-self: stretch;
align-content: stretch;
justify-content: stretch;
*****/
/********
header p.linkertext {
text-align: unset;
}
header p.rechtertext {
text-align: unset;
}
****/