Example of hover image effect on listitem
Last active
October 8, 2015 13:31
-
-
Save cyb3rD/4dd0a19c68b7520afaf1 to your computer and use it in GitHub Desktop.
Simple hover effect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .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