4
I have the following pure HTML, no CSS
<div>
<img src="_img/_banner/banner1.jpg" />
</div>
The image banner1.jpg possesses 300px
of height and to div
no dimensions have been established.
Looking at the inspector
to the imagem
we have:
Looking at the inspector
to the div
we have:
It is noticeable that, although in the inspector there is no borders
, paddings
, margins
, nothing to the image, it is somehow increasing the height of the div
for 304px
.
I would like to understand why, since there are no extra measures attached to the img
nor to div
.
I know what to apply display:block
à image, solves the problem, but I can’t understand why!
I understood and understood. But just one more question: Wouldn’t the inspector show these measures when it is the object is inline not? It helps to see where the additional measures are! Or the inspector only shows measures of what is block?
– Carlos Rocha
@Carlosrocha doesn’t completely dominate the inspector, but I don’t think he reaches that level of detail, no.
– Woss