How to create: text blocks on images
- Página anterior Texto sobre imagem
- Próxima página Texto sobre imagem transparente
Learn how to place text blocks on images.
Image text block

How to place text blocks in images
First step - Add HTML:
<div class="container"> <img src="nature.jpg" alt="Norway" style="width:100%;"> <div class="text-block"> <h4>Wuhan</h4> <p>What a great city! I love it!</p> </div> </div>
Second step - Add CSS:
/* Container for images and text */ .container { position: relative; } /* Text at the bottom right */ .text-block { position: absolute; bottom: 20px; right: 20px; background-color: black; color: white; padding-left: 20px; padding-right: 20px; }
Related pages
Tutorial:Imagem CSS
Tutorial:Posicionamento CSS
- Página anterior Texto sobre imagem
- Próxima página Texto sobre imagem transparente