Jump to content

Recommended Posts

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 by Mark Laurence

Share this post


Link to post
Share on other sites

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 by dsonesuk

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...