Why images should be nested in a div block?

To learn Webflow, I am designing a simple card with an avatar and some text on it.
Checking some websites I keep seeing that images, such as avatars, are placed inside of a div block. On some sites there could be multiple div blocks wrapped around an image. It looks like a Russian doll - a div block with another div block with an image inside. What’s the reason behind of it? Is it even necessary to do in the first place?

Hey Josef!

While it is certainly not required to wrap an image in a div block it does have it’s practicality’s. Most of the time it is because you might want to have certain styles assigned to the div block that you wouldn’t want an image to have. Sometimes it is just personal preference for organization.

Hope that helps!

1 Like

thx! it does help to understand it better

1 Like