how to overlay text on an image css
/* Container holding the image and the text */
.container {
position: relative;
text-align: center;
color: white;
}
/* Bottom
left text */
.bottom-left {
position: absolute;
bottom: 8px;
left: 16px;
}
/* Top left text */
.top-left {
position:
absolute;
top: 8px;
left: 16px;
}
/* Top right text */
.top-right {
position: absolute;
top: 8px;
right: 16px;
}
/* Bottom right text */
.bottom-right {
position: absolute;
bottom: 8px;
right: 16px;
}
/* Centered text
*/
.centered {
position:
absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
} <div class="container">
<img src="img_snow_wide.jpg" alt="Snow"
style="width:100%;">
<div class="bottom-left">Bottom Left</div>
<div class="top-left">Top Left</div>
<div class="top-right">Top
Right</div>
<div class="bottom-right">Bottom Right</div>
<div class="centered">Centered</div>
</div>
Also in CSS:
- css grid align
- round image css
- css second td in table
- font. to be thinner css
- css stop scrollbar
- css transition visibility
- add css file in html
- tailwindcss init full
- striped tables css
- flow direction in css
- how to rotate image in css
- custom selection color css
- Nuxt scss
- how to center text in css
- how to horizontal center a div in css
- css for chrome only
- how to apply a border box css
- css align backround image to the right
- how to add css file in wordpress
- how to write css in html
- insert css file in html
- multilayer shadow in css
- for loops in cpp
- how to remove bevel effect from button css