Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Div over image without absolute positioning

Tags:

html

css

I'm stuck with this... My goal is this page:

enter image description here

I want to place text over an image, for example "STALDEN". I know how to do this, but when i use absolute positioning and insert a new entry the text is on the same position like to one before. How can I solve this better?

Any help much appreciated!

This is what i have:

<div class="karte">
      <img src="img/home/stalden.png" alt="">
      <h1>STALDEN</h1>
    </div>

CSS

.karte img {
  width: 100vw;
}


.karte h1 {
  position: absolute;
  top: 50px;
  left: 50px;
  color: white;
  font-family: "Teko", sans-serif;
  font-size: 15vw;
}
like image 949
olivier Avatar asked Feb 27 '26 16:02

olivier


1 Answers

You can use image as background of your section

.karte {
  background: url('img/home/stalden.png');
}
<div class="karte">
  <h1>STALDEN</h1>
</div>
like image 95
niyasc Avatar answered Mar 02 '26 04:03

niyasc



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!