Mark Laurence Posted May 18, 2017 Share Posted May 18, 2017 (edited) The page in question is Here For the life of me, I cannot get rid of the bottom overhang. Any suggestions? I is it possible at all? <!-- THUMBNAIL --> <style> div.gallery { margin: 4px; float: left; width: 180px; } div.gallery:hover { box-shadow: 2px 0px 2px 0px rgba(0, 0, 0, .2), 0 0px 0px 0 rgba(0, 0, 0, 0.2); } div.gallery img { width: 100%; height: auto; } </style> Edited May 18, 2017 by Mark Laurence Link to comment Share on other sites More sharing options...
dsonesuk Posted May 19, 2017 Share Posted May 19, 2017 (edited) The img element is a inline element, so if you stack your code like <div class="gallery"> <a href="#"> <img class="image" src="image.jpg"> </a> </div> each html line break, causes a space the size of current font size after the image. To fix, define the image as a block element using display: block. Edited May 19, 2017 by dsonesuk Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now