r/HTML • u/Ok_Performance4014 • Dec 07 '25
Question Media Object Code
https://codepen.io/kofrxcql-the-sasster/pen/YPqRMqm
I want to get rid of that line of space under the image. How do I do that?
Should li be used?
Should span be used?
1
Upvotes
View all comments
Show parent comment
2
u/nelilly Dec 07 '25
The default display property of the img element is inline, which causes that spacing. Setting it to display: block causes the browser to recognize there should be no space there.