I have an image and a text inside it (using bootstrap 5, but that's not important)
<div class="carousel-item">
<img src="https://www.tutorialrepublic.com/lib/images/bootstrap-5.0-illustration.png" class="d-block w-100" alt="...">
<div class="carousel-caption d-none d-md-block">
<h5>First slide label</h5>
<p>Some representative placeholder content for the first slide.</p>
</div>
</div>
If the screen size is less than 800px, the text from carousel-caption
disappears (display:none;), and I want to wrap
<a href=""> </a>
so people can click on the image to proceed. Therefore, all text code should be changed to this:
<a href="">
<div class="carousel-item">
<img src="https://www.tutorialrepublic.com/lib/images/bootstrap-5.0-illustration.png" class="d-block w-100" alt="...">
<div class="carousel-caption d-none d-md-block">
<h5>First slide label</h5>
<p>Some representative placeholder content for the first slide.</p>
</div>
</div>
</a>
I'm uncertain if this can be achieved without using javascript.