CSS
main div.image { display: block; width: 100%; } main div.image img { width: 100%; height: auto; }
HTML
<div class="image"> <img src="/images/nature-1.jpg" alt=""> </div>
The problem is that this code (yes, even without any CSS, just a picture in another tag) adds extra space to the bottom of the parent block.
You may notice that the picture itself has already "ended", but some free space is added to the parent block anyway. What is the reason and how to get rid of it - the question . Although, maybe, this is normal and is added regardless of my desire, just like the margins of p
. Although you can get rid of them.
height: auto;
it seems it is not necessary to write - stackanondiv.image
is highlighted, withimg
highlighting only, there is no indent. - smellyshovel