HTML How to Make a Website Adding Pages to a Website Add Iconography

Why did we apply display block to '.contact-info a'... Why not use inline-block? What's the difference!? I am confused

.contact-info a { display: block; /* display is block, so that it will take up space? */ }

Can anyone please explain why we do this, and why use block over inline-block... Nick says its used so that it will take space. Can anyone elaborate please? Thanks

1 Answer

Steven Parker
Steven Parker
167,904 Points

Explicit size settings are ignored on flowed elements, that's the reason to set the display mode. Of course, flowed elements still "take up space", but you can't control that space the same way. I'm not sure, but perhaps that's what he meant.

A value of "inline-block" would be a good choice if you wanted the items to share the same line, but in this case "block" is chosen to place each one on a separate line.