Jump to content
Sign in to follow this  
Mark Laurence

Trying to Create Image Grid w/ Hover

Recommended Posts

The page in question is Here

I'm going to have a dozen or so images that I want lined up grid-style. They'll all be sized the same. But, I also want to have the hover overlay that's currently there. 

CSS is currently: 
 

<!-- THUMBNAIL -->

<style>

.container {
	position: relative;
	width: 50%
}

.image {
	display: block;
	margin: 3px;
	width: 50%;
	height: auto;
}

.overlay {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 3px;
	right: 0;
	height: 100%;
	width: 50%;
	opacity: 0;
	transition: .5s ease;
	background-color: #000000; 
}

.container:hover .overlay {
	opacity: 1;
}

.text {
	color: white;
	font-size: 20px;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	-ms-transform: translate(-50%, -50%);
}

</style>

HTML for each image is:

<div class="container">
		<a href="../images/thankyounotes/football_equipment.jpg" data-lightbox="kidswehelp" data-title=""><img id="football" src="../images/thankyounotes/football_equipment.jpg" class="image"></a>
			<div class="overlay">
				<div class="text">Testing This</div>
			</div>
		</div>

Thoughts? 
 

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...
Sign in to follow this  

×
×
  • Create New...