It’s Trendy! How to Make a Zoom Hover Button for the Web Without JavaScript

A “zoom hover button” is a trendy web ui element which features an image that “zooms in” when the mouse hovers over it. While it’s completely useless on a mobile page, the zoom hover button is still a really cool effect for mouse-and-computer users visiting your page.

Here’s an example (mouse over to view effect):

 

Want to make one of your own? Here’s a look at how to do it!

First, you’ll need to create a div tag in your HTML document like so:

<div class='zoombtn' id='scarveron'></div>

The class will help us control the zoom features and the id, as you’ll see, will only tell us what the background image will be.

Now, go over to your CSS document and set up the styling for your class. To start, we’re only doing this:

.zoombtn{
width: 200px;
height: 200px;
display: block;
background: black;
}

This should produce a big, black box on your page where the button should be:

Now, using your id, let’s put in a background image. The background image you are using MUST be at least twice the size of the button. In this case, the height and width of the image I’m using is 400px by 400px. I’ve chosen to Photoshop an image from my favorite comic, Scarlet Veronica. You can use whatever you like.

#scarveron{
background-image: url("http://www.archcitystudio.com/images/scarveronbtn.jpg")
}

Your picture won’t fit quite right, so we need to adjust our zoombtn CSS:

.zoombtn{
width: 200px;
height: 200px;
display: block;
//background: black;
background-size: cover;
background-position: center center;
}


Now we’ve got:

But the hover isn’t working yet, so just a little more CSS:

.zoombtn{
width: 200px;
height: 200px;
display: block;
//background: black;
background-size: cover;
background-position: center center;
}

.zoombtn:hover {
animation-name: zoomin; // the name of the animation you will be using
animation-duration: .5s; // how long the animation takes to take place
background-size: 400px auto; // this reflects the size of the background image *after* the animation
}

@keyframes zoomin {
from {background-size: 200px auto;}
to {background-size: 400px auto;}
}

And you should be all set! For extra styling effects, maybe add a box-shadow or border.

Questions or comments? Hit up that comment box below! Thanks and see you soon!

147 thoughts on “It’s Trendy! How to Make a Zoom Hover Button for the Web Without JavaScript

  1. Pingback: sildenafil coupons
  2. Pingback: cialis generic
  3. Pingback: cialis
  4. Pingback: cialis soft 20mg
  5. Pingback: benicar 10mg cost
  6. Pingback: generic cialis
  7. Pingback: cialistodo.com
  8. Pingback: buy strattera 40mg
  9. Pingback: buy cialis
  10. Pingback: viagra substitute
  11. Pingback: buy viagra
  12. Pingback: lexapro 5 mg otc
  13. Pingback: lasix 100mg price
  14. Pingback: canadian pharmacy
  15. Pingback: viagra prices
  16. Pingback: Cialis 80mg coupon
  17. Pingback: viagra
  18. Pingback: Cialis 10mg canada
  19. Pingback: viagra alternative
  20. Pingback: rxtrustpharm.com
  21. Pingback: buy sildenafil
  22. Pingback: buy viagra online
  23. Pingback: Viagra 150mg pills
  24. Pingback: generic viagra
  25. Pingback: generic viagra
  26. Pingback: buy viagra online
  27. Pingback: Yeezys
  28. Pingback: buy sildenafil
  29. Pingback: Timberland
  30. Pingback: UGG
  31. Pingback: Yeezy Shoes
  32. Pingback: Yeezy
  33. Pingback: Timberland Boots
  34. Pingback: Yeezy 350
  35. Pingback: Yeezy
  36. Pingback: buy viagra now
  37. Pingback: generic for viagra
  38. Pingback: cialis buy cialis
  39. Pingback: viagra generic
  40. Pingback: viagra sample
  41. Pingback: viagra price
  42. Pingback: online casinos usa
  43. Pingback: cialis buy
  44. Pingback: 20 cialis
  45. Pingback: generic cialis
  46. Pingback: cialis internet
  47. Pingback: cialis generic
  48. Pingback: viagra for sale
  49. Pingback: cash payday
  50. Pingback: short term loans
  51. Pingback: installment loans
  52. Pingback: buy cialis
  53. Pingback: sildenafil 100mg
  54. Pingback: play casino online
  55. Pingback: levitra vardenafil
  56. Pingback: order vardenafil
  57. Pingback: Viagra or cialis
  58. Pingback: mens ed pills
  59. Pingback: viagra 100mg
  60. Pingback: viagra for sale
  61. Pingback: viagra 50mg
  62. Pingback: generic cialis
  63. Pingback: cialis coupon
  64. Pingback: cialis 20mg price
  65. Pingback: viagra com

Leave a Reply