I often encounter an issue with divs and images not nesting flush against each other due to spaces. It's a minor problem, but it can be frustrating.
Currently, I'm struggling with the following code. The second div (class Shadow2) contains an image followed by a text-containing div with a black background caption. Ideally, visitors should see only the image above a black box with white text. However, there seems to be a default background color of Shadow2 visible between the image and the caption div.
<div class="Cool R P Max300">
<div class="Shadow2">
<img src="">
<div class="Caption Black">Text</div>
</div>
</div>
I tried adjusting the styles to set all images' border and padding to 0 and set div.Caption's top margin to 0, but it didn't solve the issue.
One workaround could be applying relative position to the image and moving it down a few pixels, but this feels like a temporary fix for a common bug. Can anyone help me understand what's causing this? Thank you.