{"id":1662,"date":"2015-08-30T19:43:40","date_gmt":"2015-08-31T00:43:40","guid":{"rendered":"http:\/\/cssnewbie.com\/?p=1662"},"modified":"2015-08-30T19:43:40","modified_gmt":"2015-08-31T00:43:40","slug":"5-awesome-css-hover-effects-and-their-codes","status":"publish","type":"post","link":"https:\/\/cssdeck.com\/blog\/5-awesome-css-hover-effects-and-their-codes\/","title":{"rendered":"5 Awesome CSS hover effects and their codes"},"content":{"rendered":"<p>Everyone loves to visit a responsive site which appears to be alive. CSS hover effects helps developers to do just that. It allows users to easily animate the images or texts of a website, making them more dynamic in appearance and it is supported by all browsers as well.<\/p>\n<h3><span style=\"font-weight: 400;\">1. Bump Up<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">One of the coolest CSS hover effects which plays best with a set of similar horizontal images, Bump Up creates the illusion of a wave with images when set side by side. Just move the mouse over the line of images and it will bob up and down, giving users the feel of something floating on water. Bump Up can be done easily by starting off with a particular margin size and reducing it on hover. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">Using transition to bring out the effect further smooths it down, however, this can be avoided and depends on what you choose. The same effect can also be done on texts, provided they are listed.<\/span><\/p>\n<p><strong>Code :\u00a0.ex1 img{ border: 5px solid #ccc; float: left; margin: 15px; -webkit-transition: margin 0.5s ease-out; -moz-transition: margin 0.5s ease-out; -o-transition: margin 0.5s ease-out; } .ex1 img:hover { margin-top: 2px; }<\/strong><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-1663\" src=\"https:\/\/cssdeck.com\/blog\/wp-content\/uploads\/2015\/08\/css-hover-effects.jpg\" alt=\"css-hover-effects\" width=\"600\" height=\"163\" \/><\/p>\n<h3><span style=\"font-weight: 400;\">2. Stack &amp; Grow<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Stack &amp; Grow takes the vertical approach while creating a wavy effect making it look like the liquid \u00a0in lava lamps. This effect is super easy to achieve. Choose similar images and stack them up vertically. Make sure they have different marginal areas. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">Once they are stacked up, simply expand them on hover and voila! The cool lava lamp effect is achieved. The expansion sometimes changes the alignment of the images which can be recreated by the use of negative scaling. Usually scaling the margin to half of the original on the negative side restores the alignment.<\/span><\/p>\n<p><strong>Code :\u00a0\/*Example 2*\/ #container { width: 300px; margin: 0 auto; } #ex2 img{ height: 100px; width: 300px; margin: 15px 0; -webkit-transition: all 1s ease; -moz-transition: all 1s ease; -o-transition: all 1s ease; } #ex2 img:hover { height: 133px; width: 400px; margin-left: -50px; }<\/strong><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-1664\" src=\"https:\/\/cssdeck.com\/blog\/wp-content\/uploads\/2015\/08\/css-hover-effects1.jpg\" alt=\"css-hover-effects\" width=\"600\" height=\"473\" \/><\/p>\n<h3><span style=\"font-weight: 400;\">3. Fade Text in<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Want something magical? Where things appear out of nowhere when you touch or click certain parts? Wouldn\u2019t it be cool if you could do the same on your website too? Like making some text or image appear out of the blank when you click certain other part of the website? It can be done the help of Fade Text in. This awesome CSS hover effect is simple to create and allows text to appear on the screen. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">All you need to do is insert the text, convert the color of the text to transparent and the height of the line to 0px which will make it vanish. Then change the color and height when on hover. This will make the text reappear when you hover your mouse over the image.<\/span><\/p>\n<p><strong>Code :\u00a0#ex3 { width: 730px; height: 133px; line-height: 0px; color: transparent; font-size: 50px; font-family: \u201cHelveticaNeue-Light\u201d, \u201cHelvetica Neue Light\u201d, \u201cHelvetica Neue\u201d, Helvetica, Arial, sans-serif; font-weight: 300; text-transform: uppercase; -webkit-transition: all 0.5s ease; -moz-transition: all 0.5s ease; -o-transition: all 0.5s ease; } #ex3:hover { line-height: 133px; color: #575858; } #ex3 img{ float: left; margin: 0 15px; }<\/strong><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-1665\" src=\"https:\/\/cssdeck.com\/blog\/wp-content\/uploads\/2015\/08\/css-hover-effects2.jpg\" alt=\"css-hover-effects\" width=\"454\" height=\"213\" \/><\/p>\n<h3><span style=\"font-weight: 400;\">4. Crooked Photo<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">This effect is a great choice for the display of thumbnails. When there are many images displayed as a thumbnail on a website, \u00a0just hover on a particular one and it would appear like a crooked wall hanging which will grab the viewer\u2019s attention. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">The crooked photo effect can be achieved by the use of transitions (optional) and it also gives users the liberty to play around with it. Designers can change the direction of leaning of images with the aid of pseudo selectors.<\/span><\/p>\n<p><strong>Code : #ex4 { width: 800px; margin: 0 auto; } #ex4 img { margin: 20px; border: 5px solid #eee; -webkit-box-shadow: 4px 4px 4px rgba(0,0,0,0.2); -moz-box-shadow: 4px 4px 4px rgba(0,0,0,0.2); box-shadow: 4px 4px 4px rgba(0,0,0,0.2); -webkit-transition: all 0.5s ease-out; -moz-transition: all 0.5s ease; -o-transition: all 0.5s ease; } #ex4 img:hover { -webkit-transform: rotate(-7deg); -moz-transform: rotate(-7deg); -o-transform: rotate(-7deg); }<\/strong><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-1666\" src=\"https:\/\/cssdeck.com\/blog\/wp-content\/uploads\/2015\/08\/css-hover-effects3.jpg\" alt=\"css-hover-effects\" width=\"600\" height=\"342\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><span style=\"font-weight: 400;\">5. Fade In and Reflect<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Ok! So we have saved the most complicated one for the last. This CSS hover effect is a bit tough to achieve, but it looks so amazing that it is worth the hard work. If you have images which are formed in the thumbnail formation, you need to reduce the opacity of all the images at large. When you hover over to a particular image, the opacity regains its normal value and the image appears brighter than the surrounding. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">It is further enhanced by the reflection that is formed at the bottom of the image. The reflection, however, does not respond to the transition and which leaves little room for customization.<\/span><\/p>\n<p><strong>Code :\u00a0#ex5 { width: 700px; margin: 0 auto; min-height: 300px; } #ex5 img { margin: 25px; opacity: 0.8; border: 10px solid #eee; \/*Transition*\/ -webkit-transition: all 0.5s ease; -moz-transition: all 0.5s ease; -o-transition: all 0.5s ease; \/*Reflection*\/ -webkit-box-reflect: below 0px -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(.7, transparent), to(rgba(0,0,0,0.1))); } #ex5 img:hover { opacity: 1; \/*Reflection*\/ -webkit-box-reflect: below 0px -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(.7, transparent), to(rgba(0,0,0,0.4))); \/*Glow*\/ -webkit-box-shadow: 0px 0px 20px rgba(255,255,255,0.8); -moz-box-shadow: 0px 0px 20px rgba(255,255,255,0.8); box-shadow: 0px 0px 20px rgba(255,255,255,0.8); }<\/strong><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-1667\" src=\"https:\/\/cssdeck.com\/blog\/wp-content\/uploads\/2015\/08\/css-hover-effects4.jpg\" alt=\"css-hover-effects\" width=\"600\" height=\"287\" \/><\/p>\n<p>Article Source : <a href=\"http:\/\/designshack.net\/\">DesignShack<\/a><\/p>\n<div class=\"wp-socializer wpsr-share-icons \" data-lg-action=\"show\" data-sm-action=\"show\" data-sm-width=\"768\" ><h3>Share and Enjoy !<\/h3><div class=\"wpsr-si-inner\"><div class=\"wpsr-counter wpsrc-sz-32px\" style=\"color:#000\"><span class=\"scount\"><span data-wpsrs=\"\" data-wpsrs-svcs=\"facebook,twitter,linkedin,pinterest,print,pdf\">0<\/span><\/span><small class=\"stext\">Shares<\/small><\/div><div class=\"socializer sr-popup sr-32px sr-circle sr-opacity sr-pad sr-count-1 sr-count-1\"><span class=\"sr-facebook\"><a rel=\"nofollow\" href=\"https:\/\/www.facebook.com\/share.php?u=\" target=\"_blank\"  title=\"Share this on Facebook\"  style=\"color: #ffffff\" ><i class=\"fab fa-facebook-f\"><\/i><span class=\"ctext\"><span data-wpsrs=\"\" data-wpsrs-svcs=\"facebook\">0<\/span><\/span><\/a><\/span>\n<span class=\"sr-twitter\"><a rel=\"nofollow\" href=\"https:\/\/twitter.com\/intent\/tweet?text=%20-%20%20\" target=\"_blank\"  title=\"Tweet this !\"  style=\"color: #ffffff\" ><i class=\"fab fa-twitter\"><\/i><\/a><\/span>\n<span class=\"sr-linkedin\"><a rel=\"nofollow\" href=\"https:\/\/www.linkedin.com\/sharing\/share-offsite\/?url=\" target=\"_blank\"  title=\"Add this to LinkedIn\"  style=\"color: #ffffff\" ><i class=\"fab fa-linkedin-in\"><\/i><\/a><\/span>\n<span class=\"sr-pinterest\"><a rel=\"nofollow\" href=\"https:\/\/www.pinterest.com\/pin\/create\/button\/?url=&amp;media=&amp;description=\" target=\"_blank\"  title=\"Submit this to Pinterest\"  style=\"color: #ffffff\" data-pin-custom=\"true\"><i class=\"fab fa-pinterest\"><\/i><span class=\"ctext\"><span data-wpsrs=\"\" data-wpsrs-svcs=\"pinterest\">0<\/span><\/span><\/a><\/span>\n<span class=\"sr-print\"><a rel=\"nofollow\" href=\"https:\/\/www.printfriendly.com\/print?url=\" target=\"_blank\"  title=\"Print this article \"  style=\"color: #ffffff\" ><i class=\"fa fa-print\"><\/i><\/a><\/span>\n<span class=\"sr-pdf\"><a rel=\"nofollow\" href=\"https:\/\/www.printfriendly.com\/print?url=\" target=\"_blank\"  title=\"Convert to PDF\"  style=\"color: #ffffff\" ><i class=\"fa fa-file-pdf\"><\/i><\/a><\/span><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Everyone loves to visit a responsive site which appears to be alive. CSS hover effects helps developers to do just that. It allows users to easily animate the images or texts of a website, making them more dynamic in appearance [&#8230;]<\/p>\n<p><a class=\"more-link article\" href=\"https:\/\/cssdeck.com\/blog\/5-awesome-css-hover-effects-and-their-codes\/\" title=\"Click to read '5 Awesome CSS hover effects and their codes'\">Read Article<\/a><\/p>\n","protected":false},"author":18,"featured_media":1663,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[171],"tags":[79],"_links":{"self":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/posts\/1662"}],"collection":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/comments?post=1662"}],"version-history":[{"count":0,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/posts\/1662\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/media\/1663"}],"wp:attachment":[{"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/media?parent=1662"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/categories?post=1662"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cssdeck.com\/blog\/wp-json\/wp\/v2\/tags?post=1662"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}