Opskrif
Die pyn self is liefde, of selfs dié met kraag.
Leer hoe om 'n prent met 'n deursigtige (deursigtige) agtergrondteks te skep, deur CSS te gebruik.
Die pyn self is liefde, of selfs dié met kraag. Jou maat tel gewoonlik twee goed op, so moenie nalaat om vir hom uit te kyk met 'n goeie doel nie. Wanneer jy 'n leuenaar vir hoogverraad vervolg, word die gewigte eers deur hom hanteer.
<div class="container">
<img src="notebook.jpg"
alt="Notebook" style="width:100%;">
<div class="content">
<h1>Heading</h1>
<p>Lorem ipsum..</p>
</div>
</div>
.container {
position: relative;
max-width: 800px;
/* Maximum width */
margin: 0 auto; /* Center it */
}
.container .content {
position: absolute; /* Position the background text */
bottom: 0;
/* At the bottom. Use top:0 to append it to the top */
background:
rgb(0, 0, 0); /* Fallback color */
background: rgba(0, 0, 0, 0.5);
/* Black background with 0.5 opacity */
color: #f1f1f1;
/* Grey text */
width: 100%; /* Full width */
padding: 20px;
/* Some padding */
}