Skip to content

Instantly share code, notes, and snippets.

@cyb3rD
Last active October 8, 2015 13:31
Show Gist options
  • Select an option

  • Save cyb3rD/4dd0a19c68b7520afaf1 to your computer and use it in GitHub Desktop.

Select an option

Save cyb3rD/4dd0a19c68b7520afaf1 to your computer and use it in GitHub Desktop.
Simple hover effect
<li class="project">
<div class="wrap-img">
<a class="project-info-link" href="#">
<span class="more-info">подробнее</span>
<img src="http://kogdago.ru/img/preview_1.png" class="img-preview" alt="1st project">
</a>
</div>
<div class="project-link">www.site.ru</div>
<div class="project-about">Информация о проекте 1 превью 2 строки</div>
</li>
.project {
margin: auto;
position: relative;
padding-right: 25px;
padding-bottom: 35px;
display: inline-block;
display: -moz-inline-stack;
width: 180px;
vertical-align: top;
text-align: center;
}
.wrap-img {
width: 100%;
height: 120px;
border: 2px solid #3ba8c0;
border-radius: 4px;
}
/* BEGIN Hover effect over project */
.wrap-img:hover .more-info {
display: block;
cursor: pointer;
/* Doesn't work for IE8 */
/*-ms-transform: translate(45px,45px);
-webkit-transform: translate(45px,45px);
transform: translate(45px,45px);*/
}
.wrap-img:hover .img-preview {
opacity: 0.2;
}/* END Hover effect over project */
.project-info-link {
display: block;
width: 100%;
height: 100%;
position: relative;
background: #016ca4;
}
.more-info {
display: none;
position: absolute;
width: 90px;
color: white;
margin-left: 45px;
margin-top: 45px;
background: #016ca4;
border: 2px solid white;
border-radius: 4px;
}
.img-preview {
height: 120px;
width: 100%;
}
.project-link {
font: italic 13px 'fira_sanslight';
color: #3ba8c0;
}
.project-about {
font: normal 15px 'fira_sanslight';
color: #4a545d;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment