CSS3 hover images animation effects
This is the demo of CSS3 animation effects when hovering the inages with Bootstraps and FontAwesome.
Github here
Step1:
link bootstrap and fontawesome stylesheet
Step2:
Html
According to Bootstrap grid layout,such as col-md-x, it's easy to bulid a responsive site.
I got four images and description content here within the box.
<i> icons are from fontawesome library.
Step3:
css
When hovering the box,there is a black shadow outside of box.
More syntax about box-shadow:
/* offset-x | offset-y | color */
box-shadow: 60px -16px teal;
/* offset-x | offset-y | blur-radius | color */
box-shadow: 10px 5px 5px black;
/* offset-x | offset-y | blur-radius | spread-radius | color */
box-shadow: 2px 2px 2px 1px rgba(0, 0, 0, 0.2);
/* inset | offset-x | offset-y | color */
box-shadow: inset 5em 1em gold;
/* Any number of shadows, separated by commas */
box-shadow: 3px 3px red, -1em 0 0.4em olive;
/* Global keywords */
box-shadow: inherit;
box-shadow: initial;
box-shadow: unset;
When hovering the images, the color of images will rotate.
More syntax about filter:
/* URL to SVG filter */
filter: url("filters.svg#filter-id");
/* <filter-function> values */
filter: blur(5px);
filter: brightness(0.4);
filter: contrast(200%);
filter: drop-shadow(16px 16px 20px blue);
filter: grayscale(50%);
filter: hue-rotate(90deg);
filter: invert(75%);
filter: opacity(25%);
filter: saturate(30%);
filter: sepia(60%);
/* Multiple filters */
filter: contrast(175%) brightness(3%);
/* Global values */
filter: inherit;
filter: initial;
filter: unset;
box-content{position:absolute;z-index:-1;} This is the way to hide the content,and do not talke space.There are also two ways to hide the content with css:
1.display:none; (do not take space)
2.visibility:hidden;(take space)
.box:before is the black filter when hovering.
.box:after is the two white border animation with changing the position.
Move the position of content with transform.
A little responsive style changes when screen resize.