I am currently working on designing a page with a banner using bootstrap. The image, which has the id "mybanner," is generated dynamically from the code. This means that there are occasions where the image element may not exist within my code. To ensure consistency in design, I want to set a minimum height for the div with the id "myhorizontalbanner." In cases where the image element is absent and the banner does not display, I would like the div with the id "myhorizontalbanner" to be colored red.
Below is my code when the image is present:
<div class="row">
<div class="col-12 bg-red-banner">
<div class="row" id="myhorizontalbanner">
<img id="mybanner" src="images/mybannerimage.jpg" class="img-fluid" /> <!--This Image
element is coming dynamically-->
</div>
</div>
</div>
And here is my code when the image is not present:
<div class="row">
<div class="col-12 bg-red-banner">
<div class="row" id="myhorizontalbanner">
</div>
</div>