Currently, I am in the process of learning how to create a responsive website using bootstrap. Although I have been making progress, I realize that my code may not be as clean as it could be. However, my current concern revolves around overlaying an image on my site.
No matter what I try, I cannot seem to make the overlay match the size of the image rather than the size of the containing <div>
.
To simplify things, I have reduced my problem down to the basic elements.
The main issue I am facing is with the padding: the background (shown in blue at the bottom of the image below) matches the size of the <div>
and <row>
, but not the size of the actual image. The image itself has inherent padding of 25px on top, 15px on the right, and another 15px on the left.
Despite trying to apply padding to the <div>
, the background still does not match the dimensions of the image. It seems that the padding within the image is related to the functioning of bootstrap...
Here is a visual representation from the Firefox console displaying the padding and div size:
The current code snippet:
I would greatly appreciate any assistance in resolving this issue. I believe there must be a solution, but my current skill level is hindering me, even after several hours of effort!
Thank you in advance for your help! :)