{"id":161,"date":"2024-05-26T16:18:49","date_gmt":"2024-05-26T16:18:49","guid":{"rendered":"https:\/\/codebox.keyframetechsolution.com\/?p=161"},"modified":"2025-02-22T17:58:44","modified_gmt":"2025-02-22T17:58:44","slug":"animated-card-hover-effects-using-only-html-css","status":"publish","type":"post","link":"https:\/\/codebox.keyframetechsolution.com\/animated-card-hover-effects-using-only-html-css\/","title":{"rendered":"How to Create Animated Card Hover Effects using HTML CSS only"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p><span data-preserver-spaces=\"true\">In <\/span><span data-preserver-spaces=\"true\">today\u2019s<\/span><span data-preserver-spaces=\"true\"> digital world, interactive web designs are becoming vital to enhance the user experience. <\/span><\/p>\n<p>One popular feature is <a href=\"https:\/\/prismic.io\/blog\/css-hover-effects\" rel=\"nofollow noopener\" target=\"_blank\">hover effects<\/a>, which can be applied to various elements, such as images, buttons, and even cards<\/p>\n<p><span data-preserver-spaces=\"true\">In this tutorial, we will walk you through <\/span><span data-preserver-spaces=\"true\">how to create<\/span><span data-preserver-spaces=\"true\"> animated card hover effects using just HTML and <\/span><span data-preserver-spaces=\"true\">CSS,<\/span><span data-preserver-spaces=\"true\"> without relying on JavaScript or any libraries.<\/span><\/p>\n<p>\u2705\u00a0<strong>Watch Live Preview<\/strong>\u00a0\ud83d\udc49\ud83d\udc49<\/p>\n<p><iframe title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/1PQBtqLV2ds?si=JQRHeuJxg9VgYTvh\" width=\"100%\" height=\"450\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p><a href=\"#conclusion\">Click Here to Download the Code<\/a><\/p>\n<div class=\"border-blog-highlight\">\n<h2>Table of Contents<\/h2>\n<ul>\n<li><a href=\"#section1\">What is a Card Hover Effect?<\/a><\/li>\n<li><a href=\"#section2\">Set Up Project<\/a><\/li>\n<li><a href=\"#section3\">HTML Code Structure<\/a><\/li>\n<li><a href=\"#section4\">CSS Code Structure<\/a><\/li>\n<li><a href=\"#section5\">Adding Hover Effects<\/a><\/li>\n<li><a href=\"#section6\">Adding Zoom-in Effect on Hover<\/a><\/li>\n<li><a href=\"#section7\">Combining Multiple Effects<\/a><\/li>\n<li><a href=\"#conclusion\">Conclusion<\/a><\/li>\n<\/ul>\n<\/div>\n<h3 id=\"section1\"><span data-preserver-spaces=\"true\">What is a Card Hover Effect?<\/span><\/h3>\n<p>It\u2019s a visual change that happens when the user hovers their mouse over a card-like element on a webpage.<\/p>\n<p><span data-preserver-spaces=\"true\">It<\/span><span data-preserver-spaces=\"true\"> can include various <\/span><span data-preserver-spaces=\"true\">types of<\/span><span data-preserver-spaces=\"true\"> animations <\/span><span data-preserver-spaces=\"true\">such<\/span><span data-preserver-spaces=\"true\"> as scaling the card, changing its background color, adding shadows, or rotating it. <\/span><\/p>\n<p><span data-preserver-spaces=\"true\">It is useful for making websites more dynamic and engaging for users.<\/span><\/p>\n<p><strong>Similar Posts:<\/strong><\/p>\n<p><a href=\"https:\/\/codebox.keyframetechsolution.com\/card-hover-effect-animation-html-css\/\">Create Responsive Card Hover Effects using HTML and CSS only<\/a><\/p>\n<p><a href=\"https:\/\/codebox.keyframetechsolution.com\/responsive-card-ui-design-with-hover-effects\/\">How to Make Responsive Card Hover Effects using HTML and CSS<\/a><\/p>\n<p><a href=\"https:\/\/codebox.keyframetechsolution.com\/3d-card-hover-effect-using-html-css-only\/\">How to Create 3D Animated Card Hover Effect using HTML CSS Only<\/a><\/p>\n<p><a href=\"https:\/\/codebox.keyframetechsolution.com\/inverted-border-radius-card-css\/\">Create Responsive Inverted Border Radius Card using HTML CSS Only<\/a><\/p>\n<h3 id=\"section2\"><strong><span data-preserver-spaces=\"true\">Set Up Project<\/span><\/strong><\/h3>\n<p><span data-preserver-spaces=\"true\">Before diving into the code, <\/span><span data-preserver-spaces=\"true\">let\u2019s<\/span><span data-preserver-spaces=\"true\"> first understand the structure of the card. <\/span><\/p>\n<p><span data-preserver-spaces=\"true\">A card consists of a container, animated images, and titles.<\/span><\/p>\n<p data-start=\"46\" data-end=\"152\">Next, create a folder on your computer for your project. Inside this folder, create the following files:<\/p>\n<ul>\n<li><strong><span data-preserver-spaces=\"true\">index.html<\/span><\/strong><\/li>\n<li><strong><span data-preserver-spaces=\"true\">style.css<\/span><\/strong><\/li>\n<li><strong><span data-preserver-spaces=\"true\">script.js<\/span><\/strong><\/li>\n<\/ul>\n<h2>Source code<\/h2>\n<h3 id=\"section3\">HTML Code Structure<\/h3>\n<p>Now that the HTML structure is complete, we will enhance the card by adding hover effects using CSS.<\/p>\n<div class=\"code-container\">\n<div class=\"toolbar\">\n<div class=\"actions\">\n        <span><\/span><br \/>\n        <span class=\"yellow\"><\/span><br \/>\n        <span class=\"green\"><\/span>\n      <\/div>\n<div class=\"title\">index.html<\/div>\n<\/p><\/div>\n<div class=\"code-content\">\n<pre><code class=\"language-markup\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html lang=\"en\"&gt;\r\n&lt;head&gt;\r\n  &lt;meta charset=\"UTF-8\"&gt;\r\n  &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;\r\n  &lt;title&gt;How to Create Animated Card Hover Effects using HTML CSS only&lt;\/title&gt;\r\n  &lt;link rel=\"stylesheet\" href=\"style.css\"&gt;\r\n  &lt;link rel=\"stylesheet\" href=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/font-awesome\/4.7.0\/css\/font-awesome.min.css\"&gt;\r\n  &lt;script src=\"https:\/\/code.jquery.com\/jquery-3.5.1.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/typed.js\/2.0.11\/typed.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/waypoints\/4.0.1\/jquery.waypoints.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.3.0-alpha1\/dist\/css\/bootstrap.min.css\"&gt;&lt;\/script&gt;\r\n  &lt;link rel=\"stylesheet\" href=\"https:\/\/fonts.googleapis.com\/css2?family=Poppins:wght@400;500;600;700&amp;family=Ubuntu:wght@400;500;700&amp;display=swap\"&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\r\n&lt;!-- CODE --&gt;\r\n\r\n&lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@5.3.0-alpha1\/dist\/js\/bootstrap.bundle.min.js\"&gt;&lt;\/script&gt;\r\n&lt;script src=\"script.js\"&gt;&lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/code><\/pre>\n<\/p><\/div>\n<\/div>\n<h3 id=\"section4\">CSS Code Structure<\/h3>\n<p>I have used basic properties like width, height, border-radius, and <a href=\"https:\/\/getcssscan.com\/css-box-shadow-examples\" rel=\"nofollow noopener\" target=\"_blank\">box-shadow<\/a> to create a clean, centered appearance on the page.<\/p>\n<div class=\"code-container\">\n<div class=\"toolbar\">\n<div class=\"actions\">\n        <span><\/span><br \/>\n        <span class=\"yellow\"><\/span><br \/>\n        <span class=\"green\"><\/span>\n      <\/div>\n<div class=\"title\">style.css<\/div>\n<\/p><\/div>\n<div class=\"code-content\">\n<pre><code class=\"language-markup\">\r\n&lt; \/* Your CSS code here *\/ &gt;\r\n&lt; * { &gt;\r\n\r\n&lt; margin: 0; &gt;\r\n&lt; padding: 0 &gt;\r\n&lt; box-sizing: border-box; &gt;\r\n&lt;     text-decoration: none; &gt;\r\n&lt;     } &gt;\r\n      <\/code><\/pre>\n<\/p><\/div>\n<\/div>\n<h3 id=\"section5\"><span data-preserver-spaces=\"true\">Adding Hover Effects<\/span><\/h3>\n<p><span data-preserver-spaces=\"true\">Now, let\u2019s dive into it. <\/span><span data-preserver-spaces=\"true\">I&#8217;ve added hover animations to the card images, so when the user hovers over them<\/span><span data-preserver-spaces=\"true\">, the effect takes place<\/span><span data-preserver-spaces=\"true\">.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">This<\/span><span data-preserver-spaces=\"true\"> could involve scaling, rotating, or <\/span><span data-preserver-spaces=\"true\">even<\/span><span data-preserver-spaces=\"true\"> changing the card\u2019s shadow. <\/span><\/p>\n<p><span data-preserver-spaces=\"true\">For this example, I\u2019ve made the card scale up slightly and added a shadow to create a more interactive and dynamic feel when hovered.<\/span><\/p>\n<h3 id=\"section6\"><span data-preserver-spaces=\"true\">Adding Zoom-in Effect on Hover<\/span><\/h3>\n<p><span data-preserver-spaces=\"true\">In this guide, I have also included a zoom-in effect on hover, where the card enlarges as the user hovers over it. <\/span><\/p>\n<p><span data-preserver-spaces=\"true\">You can combine<\/span><span data-preserver-spaces=\"true\"> this with a shadow effect <\/span><span data-preserver-spaces=\"true\">to create<\/span><span data-preserver-spaces=\"true\"> a more dynamic feel.<\/span><\/p>\n<h3 id=\"section7\"><span data-preserver-spaces=\"true\">Combining Multiple Effects<\/span><\/h3>\n<p><span data-preserver-spaces=\"true\">You can also combine different effects for a more unique animation. <\/span><span data-preserver-spaces=\"true\">For example, you can use <\/span><span data-preserver-spaces=\"true\">both the zoom-in effect<\/span><span data-preserver-spaces=\"true\"> and <\/span><span data-preserver-spaces=\"true\">the<\/span><span data-preserver-spaces=\"true\"> flip <\/span><span data-preserver-spaces=\"true\">effect<\/span><span data-preserver-spaces=\"true\"> on the same card.<\/span><\/p>\n<h2 id=\"conclusion\"><span data-preserver-spaces=\"true\">Conclusion<\/span><\/h2>\n<p><span data-preserver-spaces=\"true\">By learning this,<\/span><span data-preserver-spaces=\"true\"> you can create engaging and interactive animated card hover effects.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">By utilizing CSS properties like transform, box-shadow, perspective, and transition, you can add dynamic visual effects that improve the user experience.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Remember, you can customize these effects to suit your<\/span><span data-preserver-spaces=\"true\"> website\u2019<\/span><span data-preserver-spaces=\"true\">s design and functionality. <\/p>\n<p>Whether<\/span><span data-preserver-spaces=\"true\"> you\u2019r<\/span><span data-preserver-spaces=\"true\">e building a portfolio, a<\/span> <span data-preserver-spaces=\"true\">product showcase, or a simple information card, these hover effects will help your design stand out.<\/span><\/p>\n<p><strong>33 people bought this<\/strong><\/p>\n<p><strong>Grab it Now for Just <i class=\"fa fa-rupee\" style=\"color: #046bd2;\"><\/i><span style=\"color: #046bd2;\">20<\/span><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In today\u2019s digital world, interactive web designs are becoming vital to enhance the user experience. One popular feature is [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":164,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"footnotes":""},"categories":[4],"tags":[444,443,119,445],"class_list":["post-161","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hover-effects","tag-animated-card-hover-effect-css","tag-animated-card-hover-effects-html-css","tag-card-hover-effect","tag-card-hover-effect-css"],"acf":[],"_links":{"self":[{"href":"https:\/\/codebox.keyframetechsolution.com\/wp-json\/wp\/v2\/posts\/161","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codebox.keyframetechsolution.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codebox.keyframetechsolution.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codebox.keyframetechsolution.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/codebox.keyframetechsolution.com\/wp-json\/wp\/v2\/comments?post=161"}],"version-history":[{"count":10,"href":"https:\/\/codebox.keyframetechsolution.com\/wp-json\/wp\/v2\/posts\/161\/revisions"}],"predecessor-version":[{"id":1622,"href":"https:\/\/codebox.keyframetechsolution.com\/wp-json\/wp\/v2\/posts\/161\/revisions\/1622"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codebox.keyframetechsolution.com\/wp-json\/wp\/v2\/media\/164"}],"wp:attachment":[{"href":"https:\/\/codebox.keyframetechsolution.com\/wp-json\/wp\/v2\/media?parent=161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codebox.keyframetechsolution.com\/wp-json\/wp\/v2\/categories?post=161"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codebox.keyframetechsolution.com\/wp-json\/wp\/v2\/tags?post=161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}