What I want to do is place a heading over an image. What is bothering me is that in full-screen the heading is working perfectly with the image but as soon as I shrink the screen, the heading stays exactly the same proportions as in full-screen. I cannot seem to make it respond with this code that I used, and also cannot seem to find the mistake. Also tried height and width in percentages, didn´t work. I would much appreciate it if someone helped me. Thank you!
<header>
<img src="./img/web-dizajn.jpg" alt="swd-web-dizajn">
<h2 class="tagline">This is the heading!</h2>
</header>```
.intro-section header{
position: relative
}
.intro-section header img{
width: 100% ;
}
.tagline{
color: #fff;
font-size: 40px;
text-align: right;
background-color: rgba(255, 153, 0, 0.9);
padding: 40px;
margin: 0;
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
}