Hoe OM - Teksblokkies oor beeld
Leer hoe om teksblokke oor 'n prent te plaas.
Prentteksblokke
Hoe om teksblokke in beeld te plaas
Stap 1) Voeg HTML by:
Voorbeeld
<div class="container">
<img src="nature.jpg" alt="Norway"
style="width:100%;">
<div class="text-block">
<h4>Nature</h4>
<p>What a beautiful sunrise</p>
</div>
</div>
Stap 2) Voeg CSS by:
Voorbeeld
/* Container holding the image and the text */
.container {
position: relative;
}
/* Bottom right text */
.text-block {
position: absolute;
bottom: 20px;
right: 20px;
background-color: black;
color: white;
padding-left: 20px;
padding-right: 20px;
}
Om meer te wete te kom oor hoe om beelde te stileer, lees ons CSS Images - tutoriaal.
Om meer te wete te kom oor CSS-posisionering, lees ons CSS Posisie - tutoriaal.