Hover Buttons

Developer
Size
2,311 Kb
Views
26,312

How do I make an hover buttons?

An example of using the same style for each button with classes and then setting a different image per button using ids.. What is a hover buttons? How do you make a hover buttons? This script and codes were developed by Lauren on 18 September 2022, Sunday.

Hover Buttons Previews

Hover Buttons - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Hover Buttons</title> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ * { margin: 0px; padding: 0px; box-sizing: border-box;
}
html, body { background: #43423A; text-align: center; width: 100%; height: 100%;
}
.button { display: inline-block; margin: 20px 5px 0px; position: relative; background-position: top center; width: 200px; height: 360px; cursor: pointer;
}
.button span { display: block; position: absolute; top: 0px; left: 0px; bottom: 0px; right: 0px; background-position: bottom center; opacity: 0; transition: opacity 0.5s linear 0s;
}
.button:hover span { opacity: 1;
}
.button#road, .button#road span { background-image: url('https://www.columbia.edu/~ljz2112/resources/button_sprite_road.png');
}
.button#city, .button#city span { background-image: url('https://www.columbia.edu/~ljz2112/resources/button_sprite_city.png');
}
.button#flower, .button#flower span { background-image: url('https://www.columbia.edu/~ljz2112/resources/button_sprite_flower.png');
}
.button#wire, .button#wire span { background-image: url('https://www.columbia.edu/~ljz2112/resources/button_sprite_wire.png');
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div id="road" class="button"><span></span></div>
<div id="city" class="button"><span></span></div>
<div id="flower" class="button"><span></span></div>
<div id="wire" class="button"><span></span></div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
</body>
</html>

Hover Buttons - Script Codes CSS Codes

* { margin: 0px; padding: 0px; box-sizing: border-box;
}
html, body { background: #43423A; text-align: center; width: 100%; height: 100%;
}
.button { display: inline-block; margin: 20px 5px 0px; position: relative; background-position: top center; width: 200px; height: 360px; cursor: pointer;
}
.button span { display: block; position: absolute; top: 0px; left: 0px; bottom: 0px; right: 0px; background-position: bottom center; opacity: 0; transition: opacity 0.5s linear 0s;
}
.button:hover span { opacity: 1;
}
.button#road, .button#road span { background-image: url('https://www.columbia.edu/~ljz2112/resources/button_sprite_road.png');
}
.button#city, .button#city span { background-image: url('https://www.columbia.edu/~ljz2112/resources/button_sprite_city.png');
}
.button#flower, .button#flower span { background-image: url('https://www.columbia.edu/~ljz2112/resources/button_sprite_flower.png');
}
.button#wire, .button#wire span { background-image: url('https://www.columbia.edu/~ljz2112/resources/button_sprite_wire.png');
}
Hover Buttons - Script Codes
Hover Buttons - Script Codes
Home Page Home
Developer Lauren
Username phantomesse
Uploaded September 18, 2022
Rating 3.5
Size 2,311 Kb
Views 26,312
Do you need developer help for Hover Buttons?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Lauren (phantomesse) Script Codes
Create amazing sales emails with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!