CSS image/content hovers
How do I make an css image/content hovers?
Working on a project and I wanted to use just css on the hover states to "switch" out some content instead of jquery toggles and stuff. Could probably do it with pseudos too.. What is a css image/content hovers? How do you make a css image/content hovers? This script and codes were developed by Patrick Cox on 04 September 2022, Sunday.
CSS image/content hovers - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>CSS image/content hovers</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <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! */ /**, *:before, *:after{box-sizing: border-box;}*/
html{ box-shadow: inset 0 0 200px rgba(0,0,0,0.3); height: 100%;
}
body{ font-family: 'helvetica', arial, sans-serif; margin: 0 auto; padding-top: 6%; width: 890px;
}
.box{ background: #ddd; border: 2px solid #fff; box-shadow: 0 0 3px rgba(0,0,0,0.5), inset 0 0 100px rgba(0,0,0,0.4); float: left; height: 200px; margin: 10px; position: relative; width: 200px; transition: background 0.3s ease-out;
}
.box p{ color: #eee; font-size: 34px; line-height: 34px; padding: 12px; opacity: 0; text-align: center; text-shadow: 0 -2px 1px rgba(0,0,0,0.25), 0 2px 0 #fff; position: absolute; top: 0;
}
.box img{ height: 200px; width: 200px; opacity: 1; display: block; transition: opacity 0.3s ease-in-out;
}
.box:hover img{ opacity: 0;
}
/* box colors */
.box:hover p{ opacity: 1; transition: opacity 0.5s ease-in-out;
}
.box:nth-child(1):hover{ background: #bd8cbf;
}
.box:nth-child(2):hover{ background: #f68e56;
}
.box:nth-child(3):hover{ background: #7cc576;
}
.box:nth-child(4):hover{ background: #448ccb;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <section class="box"> <img src="https://goo.gl/i7XHY"/> <p>text on hover for box 1</p>
</section>
<section class="box"> <img src="https://goo.gl/zixZ0"/> <p>text on hover for box 2</p>
</section>
<section class="box"> <img src="https://goo.gl/fDNr9"/> <p>text on hover for box 3</p>
</section>
<section class="box"> <img src="https://goo.gl/uUqoH"/> <p>text on hover for box 4</p>
</section> <script src="js/index.js"></script>
</body>
</html>
CSS image/content hovers - Script Codes CSS Codes
/**, *:before, *:after{box-sizing: border-box;}*/
html{ box-shadow: inset 0 0 200px rgba(0,0,0,0.3); height: 100%;
}
body{ font-family: 'helvetica', arial, sans-serif; margin: 0 auto; padding-top: 6%; width: 890px;
}
.box{ background: #ddd; border: 2px solid #fff; box-shadow: 0 0 3px rgba(0,0,0,0.5), inset 0 0 100px rgba(0,0,0,0.4); float: left; height: 200px; margin: 10px; position: relative; width: 200px; transition: background 0.3s ease-out;
}
.box p{ color: #eee; font-size: 34px; line-height: 34px; padding: 12px; opacity: 0; text-align: center; text-shadow: 0 -2px 1px rgba(0,0,0,0.25), 0 2px 0 #fff; position: absolute; top: 0;
}
.box img{ height: 200px; width: 200px; opacity: 1; display: block; transition: opacity 0.3s ease-in-out;
}
.box:hover img{ opacity: 0;
}
/* box colors */
.box:hover p{ opacity: 1; transition: opacity 0.5s ease-in-out;
}
.box:nth-child(1):hover{ background: #bd8cbf;
}
.box:nth-child(2):hover{ background: #f68e56;
}
.box:nth-child(3):hover{ background: #7cc576;
}
.box:nth-child(4):hover{ background: #448ccb;
}
CSS image/content hovers - Script Codes JS Codes
// images from http://theskateboardmag.com
Developer | Patrick Cox |
Username | pcridesagain |
Uploaded | September 04, 2022 |
Rating | 4 |
Size | 2,765 Kb |
Views | 24,288 |
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!
Name | Size |
IOS web app bookmark reminder bubble | 2,576 Kb |
Sexy Version - iOS web app bookmark reminder bubble | 2,880 Kb |
A Pen by Patrick Cox | 3,176 Kb |
Single Element Pure CSS US Flag | 1,875 Kb |
A Pen by Patrick Cox | 2,899 Kb |
CSS Q-Bert | 4,926 Kb |
Vans Logo, single element, no fonts, no psuedos | 3,162 Kb |
Responsive Content Experiment | 4,586 Kb |
A Better Moustache | 3,139 Kb |
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!
Name | Username | Size |
Flip test | Madhes | 1,635 Kb |
Sencha Touch 2.3.1 Basic Grid Example | Trozdol | 2,770 Kb |
Css Rotating 3d cubes different speed | Dghez | 2,364 Kb |
Airbnb Homepage | SindhujaD | 2,480 Kb |
Transition | Shayhowe | 1,632 Kb |
Image Stack Test SCSS | CalvinMorett | 2,799 Kb |
A Pen by Adrien Clerbois | AClerbois | 6,501 Kb |
TestTube CSS | EZPK | 2,710 Kb |
This in constructor context | _shree33 | 1,718 Kb |
A Pen by Miro Olma | Programiro | 2,342 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!