I have the following content in a html file.
<body>
<img src="img/img1.svg" alt="" />
<hr />
<div class="flex-container">
<img src="img/img1.svg" alt="" />
</div>
</body>
.flex-container {
display: flex;
}
Basically, it's just a simple webpage with 2 identical images. The only difference is just that the first <img />
element is stand-alone, while the second one is nested inside a flex container.
By default, <img />
is inline element. When I open the chrome dev tool and inspect the 1st image, I get the following result:
However, when I inspect the second image, I find the display property of the img is changed to block:
I'm confused. I don't understand why and how the second image element is changed from inline to block. By looking into the Styles tab, I cannot see any changes to either of the 2 image elements, but the computed values for display property are different