Social media sharing is a crucial aspect of modern websites. Adding a Fixed Social Media Sidebar Widget enhances user experience and increases content reach by encouraging visitors to share your content on their favourite platforms. In this guide, I’ll walk you through creating a visually engaging and responsive Fixed Social Media Sidebar Widget using HTML and CSS.

Why Use a Fixed Social Media Sidebar Widget?

A Fixed Social Media Sidebar Widget is an excellent way to keep social sharing buttons accessible to users as they scroll through your site. This consistent visibility improves engagement and encourages users to share your content without interrupting their browsing experience.

Some of the advantages include:

  1. Improved User Engagement: Users can easily share content without searching for buttons.
  2. Enhanced Visual Appeal: A well-designed widget adds a professional look to your site.
  3. Increased Traffic: Sharing buttons encourage organic traffic from social platforms.

Key Features of the Fixed Social Media Sidebar Widget

This widget includes the following features:

  • Fixed position on the screen, visible at all times.
  • Social media icons styled with smooth hover effects.
  • Design optimized for seamless viewing across all screen sizes.

How Fixed Social Media Sidebar Widget Works

This Fixed Social Media Sidebar Widget uses pure HTML and CSS for its functionality and appearance. The widget consists of:

  • HTML for the structure, including anchor links and icons.
<!DOCTYPE html>
<!-- Created By abhikesh.com -->
<html lang="en" dir="ltr">
<head>
  <meta charset="utf-8">
  <title>Floating Icons on Left Border</title>
  <link rel="stylesheet" href="style.css">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" />
</head>
<body>
  <nav>
    <ul>
      <li><a href="#"><i class="fab fa-facebook-f"></i><span>Facebook</span></a></li>
      <li><a href="#"><i class="fab fa-twitter"></i><span>Twitter</span></a></li>
      <li><a href="#"><i class="fab fa-instagram"></i><span>Instagram</span></a></li>
      <li><a href="#"><i class="fab fa-linkedin-in"></i><span>Linkedin</span></a></li>
      <li><a href="#"><i class="fab fa-github"></i><span>Github</span></a></li>
      <li><a href="#"><i class="fab fa-youtube"></i><span>Youtube</span></a></li>
    </ul>
  </nav>
</body>
</html>
  • CSS for styling, animations, and responsiveness.
  <style>
    @import url('https://fonts.googleapis.com/css?family=Montserrat:600&display=swap');
    * {
      margin: 0;
      padding: 0;
      list-style: none;
      text-decoration: none;
      box-sizing: border-box;
    }
    body {
      font-family: 'Montserrat', sans-serif;
      background: url(bg.jpeg);
      background-position: center;
      background-size: cover;
      height: 100vh;
    }
    nav {
      position: fixed;
      width: 70px;
      margin-top: 150px;
      transition: all 0.3s linear;
      box-shadow: 2px 2px 8px 0px rgba(0, 0, 0, .4);
    }
    nav li {
      height: 60px;
      position: relative;
    }
    nav li a {
      color: white;
      display: block;
      height: 100%;
      width: 100%;
      line-height: 60px;
      padding-left: 25%;
      border-bottom: 1px solid rgba(0, 0, 0, .4);
      transition: all .3s linear;
    }
    nav li:nth-child(1) a {
      background: #4267B2;
    }
    nav li:nth-child(2) a {
      background: #1DA1F2;
    }
    nav li:nth-child(3) a {
      background: #E1306C;
    }
    nav li:nth-child(4) a {
      background: #2867B2;
    }
    nav li:nth-child(5) a {
      background: #333;
    }
    nav li:nth-child(6) a {
      background: #ff0000;
    }
    nav li a i {
      position: absolute;
      top: 17px;
      left: 20px;
      font-size: 27px;
    }
    ul li a span {
      display: none;
      font-weight: bold;
      letter-spacing: 1px;
      text-transform: uppercase;
    }
    a:hover {
      z-index: 1;
      width: 200px;
      border-bottom: 1px solid rgba(0, 0, 0, .5);
      box-shadow: 0 0 1px 1px rgba(0, 0, 0, .3);
    }
    ul li:hover a span {
      padding-left: 30%;
      display: block;
    }
  </style>

No JavaScript is required, making the widget lightweight and fast.

Steps to Create the Widget

Step 1: Set Up the HTML File

Start by creating an index.html file. This file will include the structure of your widget with social media icons placed inside tags.

Step 2: Style the Widget with CSS

Create a style.css file to design the widget. Use CSS properties like position: fixed to keep the sidebar in place and hover effects to enhance user interaction.

Customizing the Design

Feel free to experiment with colours, fonts, and icon sizes to match your website’s theme. Add tooltips or modify the hover effects for a more interactive experience.

Tips for Customization:

  1. Colour Scheme: Use colours that align with your brand identity.
  2. Icons: Ensure you use high-quality, recognizable icons for social platforms.
  3. Responsiveness: Test the widget on multiple devices for compatibility.
SEO Benefits of Social Sharing Widgets

Integrating a Fixed Social Media Sidebar Widget has direct and indirect benefits for your site’s SEO:

  • Improved User Experience: Better UX can lead to lower bounce rates.
  • Increased Social Signals: Social shares contribute to traffic and may indirectly influence search engine rankings.
  • Content Visibility: Shared content gains exposure on social platforms, driving more traffic.
Want to Check Username Availability on Social Media?If you’re looking to check username availability on various social media platforms, visit NameChkr to find out!
Read Also

  1. Glassmorphism Login Form in HTML and CSS
    Explore the stylish world of glassmorphism as you create a modern login form using HTML and CSS. This guide breaks down the design process step by step.
  2. Toggle Button using HTML, CSS, and JavaScript
    Discover how to enhance user interaction by creating a sleek toggle button with HTML, CSS, and JavaScript. This tutorial covers everything from structure to styling.
  3. Responsive Cards in HTML and CSS
    Learn how to design eye-catching responsive cards that adapt seamlessly to any device. This guide offers practical tips for achieving stunning layouts.
  4. Build a Google Gemini Chatbot Using HTML, CSS, and JS
    Dive into chatbot development by creating a Google Gemini chatbot with HTML, CSS, and JavaScript. This tutorial will help you understand the basics of interactive forms.

Download the Source Code

Ready to implement this feature? Download the complete source code for the Fixed Social Media Sidebar Widget by clicking the button below.

Following this guide, you can create a professional and functional Fixed Social Media Sidebar Widget that enhances user experience and website performance. Happy coding! 🎉

Introduction

In today’s digital age, user experience is paramount, and one essential feature that enhances this experience is the Scroll To Top Button. This small yet significant functionality enables users to navigate back to the top of a webpage effortlessly, especially on content-heavy sites.

In this article, we’ll discuss how to create a Scroll Button using only HTML and CSS, making your website visually appealing and highly functional. Let’s dive into why this feature is essential and how you can implement it seamlessly.

Why Is a Scroll To Top Button Essential?

Enhances User Experience

A Scroll To the Top Button simplifies user navigation. Instead of manually scrolling back, a single click takes them straight to the top. This is especially useful for long web pages or blogs where users must revisit the header section.

Improves Accessibility

This feature is particularly beneficial for users accessing your site on mobile devices. With smaller screens and touch interfaces, navigating to the top can be cumbersome without this button.

Saves Time

A Scroll To Top Button reduces the effort required to scroll back up, ensuring a smoother browsing experience and saving valuable time for your visitors.

Benefits of a Scroll To Top Button

Lightweight and Fast

This feature is lightweight when created using only HTML and CSS, ensuring quick load times and better site performance.

Customizable Design

The button can be styled to match your website’s theme, colours, and branding, making it a cohesive part of your design.

Professional Appearance

A well-placed Scroll To Top Button enhances the overall aesthetics of your website, giving it a polished, professional look.

How to Use a Scroll To Top Button Effectively

Placement

The button is typically positioned at the bottom right corner of the screen. This location is intuitive and ensures it doesn’t obstruct the main content.

Visibility

The button should appear to users only after they have scrolled down the page. This ensures it’s not distracting when unnecessary.

Design Considerations

  • Use a subtle yet noticeable colour scheme.
  • Add smooth scrolling effects for a better visual experience.
  • Include an icon, such as an arrow, to make its function instantly recognizable.

Advantages of Including aScroll To Top Button for SEO

Adding a Scroll To the Top Button indirectly improves SEO by improving user engagement metrics. Here’s how:

  • Lower Bounce Rate: A well-designed button keeps users on your site longer, reducing their chances of leaving early.
  • Improved Dwell Time: Enhanced navigation encourages users to explore more sections of your site.
  • Better User Experience: Search engines favour websites that prioritize usability and accessibility.

Real-World Applications

Many popular websites, including blogs, e-commerce platforms, and news portals, utilize the Scroll To Top Button. This feature is ubiquitous on:

  • Blogs: Helps readers navigate easily after scrolling through lengthy articles.
  • E-commerce Sites: Simplifies navigation for users browsing multiple product listings.
  • Corporate Websites: Enhances accessibility on information-rich pages.
How to Implement a Scroll-Top Button

Creating a Scroll To Top Button with HTML and CSS is straightforward. The process involves:

  1. Defining the button in your HTML file.
  2. <!DOCTYPE html>
    <html lang="en" dir="ltr">
    <head>
        <meta charset="utf-8">
        <title>Scroll to Top Button | Abhikesh Kumar</title>
        <link rel="stylesheet" href="style.css">
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" />
    </head>
    <body>
        <div class="arrow"> <a href="#" title="Back to Top"><span class="fas fa-angle-up"></span></a> </div>
        <nav>
            <div class="logo"> Abhikesh </div>
        </nav>
        <div class="content">
            <h2 class="header"> Scroll to Top Button </h2>
            <p> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Id quibusdam assumenda, suscipit odit illo
                deserunt
                aut placeat illum soluta? Tenetur nisi nostrum animi ratione rem, ex repellendus distinctio. Necessitatibus
                nam
                magnam omnis aspernatur molestiae temporibus iste quibusdam qui dicta aperiam beatae nisi ipsam architecto,
                voluptas perferendis voluptatibus saepe ipsum earum sapiente explicabo fugit consequuntur deleniti, illo
                sequi.
                Amet numquam est quia explicabo nihil quas nemo dolor doloribus ipsa molestiae voluptatibus, aspernatur
                repellat
                in tempora temporibus voluptas itaque ratione expedita eveniet iste minus, eligendi cumque et laudantium.
                Natus,
                eos ad nemo, dolor velit veniam similique assumenda dolorem, illo vel quo nesciunt. </p>
            <p> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Modi iure exercitationem illum omnis officiis quae
                magnam praesentium neque amet cum necessitatibus aliquid illo minus inventore voluptate reiciendis debitis,
                consequuntur libero ducimus cumque, quis totam quidem beatae in. Excepturi non culpa enim nesciunt iste
                molestias
                aperiam possimus, suscipit blanditiis corporis. Fugit eius, possimus. Nostrum fugit, animi voluptatibus quia
                reprehenderit perferendis culpa sint doloremque sapiente, vel explicabo veritatis quasi dolore
                necessitatibus
                rerum libero aperiam facilis a repellendus. Sed sint laboriosam odit itaque sequi corporis, consectetur
                amet,
                tenetur aspernatur, optio iure atque, asperiores quisquam eveniet laborum porro reiciendis expedita aperiam.
                Ipsum, ex eum, corporis odit perspiciatis eaque blanditiis reprehenderit quaerat fugit culpa voluptatum,
                cupiditate distinctio placeat. Temporibus enim ratione iste reiciendis, vitae et repudiandae ex obcaecati
                doloribus modi molestias facilis, recusandae adipisci nisi aperiam suscipit mollitia, aliquam! Iste sunt
                consequuntur modi quis mollitia, pariatur velit deserunt tempora magni id, tempore sint suscipit numquam!
            </p>
            <h2> About Section </h2>
            <p> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Incidunt deleniti molestias natus vero sed,
                officia,
                doloremque quod reiciendis cumque labore exercitationem cupiditate suscipit iusto. Repellendus consequatur,
                iste
                deleniti consequuntur eius perspiciatis culpa temporibus cum nobis placeat inventore similique modi cumque
                dignissimos! Numquam accusamus eveniet animi vero, temporibus minus, nostrum, a pariatur ab repudiandae
                deleniti
                ratione eligendi quae ipsam fugit ullam ipsum ad ipsa tempore, adipisci sunt optio nemo earum. Repellat
                corporis
                nobis pariatur amet facilis, nisi rem voluptates obcaecati nesciunt dolore non et alias magni recusandae
                praesentium explicabo. Blanditiis amet nesciunt tenetur aliquid est aperiam pariatur itaque incidunt dolorum
                deserunt? </p>
            <ul>
                <li>List item 1</li>
                <li>List item 2</li>
                <li>List item 3</li>
            </ul>
            <h2> Services Section </h2>
            <p> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Incidunt deleniti molestias natus vero sed,
                officia,
                doloremque quod reiciendis cumque labore exercitationem cupiditate suscipit iusto. Repellendus consequatur,
                iste
                deleniti consequuntur eius perspiciatis culpa temporibus cum nobis placeat inventore similique modi cumque
                dignissimos! Numquam accusamus eveniet animi vero, temporibus minus, nostrum, a pariatur ab repudiandae
                deleniti
                ratione eligendi quae ipsam fugit ullam ipsum ad ipsa tempore, adipisci sunt optio nemo earum. Repellat
                corporis
                nobis pariatur amet facilis, nisi rem voluptates obcaecati nesciunt dolore non et alias magni recusandae
                praesentium explicabo. Blanditiis amet nesciunt tenetur aliquid est aperiam pariatur itaque incidunt dolorum
                deserunt? </p>
            <ul>
                <li>List item 1</li>
                <li>List item 2</li>
                <li>List item 3</li>
            </ul>
            <h2> Contact Section </h2>
            <p> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Incidunt deleniti molestias natus vero sed,
                officia,
                doloremque quod reiciendis cumque labore exercitationem cupiditate suscipit iusto. Repellendus consequatur,
                iste
                deleniti consequuntur eius perspiciatis culpa temporibus cum nobis placeat inventore similique modi cumque
                dignissimos! Numquam accusamus eveniet animi vero, temporibus minus, nostrum, a pariatur ab repudiandae
                deleniti
                ratione eligendi quae ipsam fugit ullam ipsum ad ipsa tempore, adipisci sunt optio nemo earum. Repellat
                corporis
                nobis pariatur amet facilis, nisi rem voluptates obcaecati nesciunt dolore non et alias magni recusandae
                praesentium explicabo. Blanditiis amet nesciunt tenetur aliquid est aperiam pariatur itaque incidunt dolorum
                deserunt? </p>
        </div>
    </body>
    </html>
  3. Styling it for visibility and responsiveness in your CSS file.
  4. <style>
        @import url('https://fonts.googleapis.com/css?family=Poppins:400,500,600,700&display=swap');
        * {
            margin: 0;
            padding: 0;
            font-family: 'Poppins', sans-serif;
        }
        html {
            scroll-behavior: smooth;
        }
        nav {
            height: 70px;
            width: 100%;
            background: #1b1b1b;
        }
        nav .logo {
            padding-left: 100px;
            line-height: 70px;
            color: #f2f2f2;
            font-size: 30px;
            font-weight: 600;
            font-family: 'Poppins', sans-serif;
        }
        .content {
            position: relative;
            top: 10px;
            padding: 0 100px;
        }
        .content h2.header {
            font-size: 40px;
        }
        .content p {
            padding: 10px 0;
            font-size: 17px;
            text-align: justify;
        }
        .content h2 {
            font-size: 35px;
        }
        .content ul {
            padding-left: 30px;
        }
        ul li {
            font-size: 20px;
        }
        .arrow {
            position: fixed;
            bottom: 30px;
            right: 30px;
            z-index: 9;
        }
        .arrow a {
            height: 39px;
            width: 37px;
            text-align: center;
            background: #1b1b1b;
            display: block;
            border-radius: 3px;
        }
        .arrow a span {
            color: #f2f2f2;
            font-size: 25px;
            line-height: 39px;
            cursor: pointer;
        }
    </style>
  5. Ensuring smooth scrolling behaviour with minimal CSS tweaks.
Best Practices for a Scroll To Top Button

Keep It Minimal

Avoid cluttering the design with excessive animations or graphics. A simple arrow icon and clean styling work best.

Test on Multiple Devices

Make sure the button works flawlessly on all gadgets, including tablets, smartphones, and PCs.

Optimize for Speed

Since this feature relies solely on HTML and CSS, ensure your code is clean and efficient for faster loading times.

Want to Check Username Availability on Social Media?If you’re looking to check username availability on various social media platforms, visit NameChkr to find out!
Read Also

  1. Glassmorphism Login Form in HTML and CSS
    Explore the stylish world of glassmorphism as you create a modern login form using HTML and CSS. This guide breaks down the design process step by step.
  2. Toggle Button using HTML, CSS, and JavaScript
    Discover how to enhance user interaction by creating a sleek toggle button with HTML, CSS, and JavaScript. This tutorial covers everything from structure to styling.
  3. Responsive Cards in HTML and CSS
    Learn how to design eye-catching responsive cards that adapt seamlessly to any device. This guide offers practical tips for achieving stunning layouts.
  4. Build a Google Gemini Chatbot Using HTML, CSS, and JS
    Dive into chatbot development by creating a Google Gemini chatbot with HTML, CSS, and JavaScript. This tutorial will help you understand the basics of interactive forms.

Conclusion

A Scroll To Top Button is more than just a navigational aid; it’s a powerful feature that enhances usability, improves accessibility, and contributes to better SEO performance. Implementing this feature using HTML and CSS allows you to create a seamless and engaging experience for your website visitors.

Whether you run a blog, an online store, or a corporate website, adding a Scroll Top Button is a small step toward creating a user-friendly and professional platform.

Download Source Code

If you have any questions or encounter issues while implementing this feature, feel free to contact us via the comments or the contact page.

Social Media Buttons are crucial in modern web design, enabling seamless sharing and interaction across various platforms. In this guide, we’ll create Social Media Buttons with a 3D hover effect using HTML and CSS only. Adding 3D hover effects to these buttons enhances their visual appeal and boosts user engagement, leading to higher interaction rates and content sharing.

What Are Social Media Buttons?

Social Media Buttons are interactive elements on a website that provide visitors a quick way to share content. When designed effectively, these buttons encourage users to promote content, increasing reach and visibility on various social platforms. They’re a staple in modern web design, especially for content-driven sites and blogs, as they allow effortless content sharing.

Why Use 3D Hover Effects on Social Media Buttons?

The primary purpose of a 3D hover effect is to enhance the user experience by adding visual depth to the Social Media Buttons. Hover effects help capture the user’s attention and make buttons feel more interactive. This simple yet impactful design element is created using only HTML and CSS, keeping the code lightweight and easy to load.

Step-by-Step Guide to Creating Social Media Buttons with 3D Hover Effect

This guide will cover the HTML and CSS needed to create Social Media Buttons with a visually appealing 3D effect.

HTML Structure for Social Media Buttons

First, we’ll set up a simple HTML structure. This HTML file will hold the code for three social media buttons: Facebook, Twitter, and Instagram. Here’s the HTML code you’ll need:

<!DOCTYPE html>
<!-- Created By abhikesh.com -->
<html lang="en" dir="ltr">
<head>
    <meta charset="utf-8">
    <title>3D Layered Hover Effect | Abhikesh</title>
    <link rel="stylesheet" href="style.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" />
</head>
<body>
    <div class="icons">
        <a href="#">
            <div class="layer">
                <span></span>
                <span></span>
                <span></span>
                <span></span>
                <span class="fab fa-facebook-f"></span>
            </div>
            <div class="text">
                Facebook
            </div>
        </a>
        <a href="#">
            <div class="layer">
                <span></span>
                <span></span>
                <span></span>
                <span></span>
                <span class="fab fa-twitter"></span>
            </div>
            <div class="text">
                Twitter
            </div>
        </a>
        <a href="#">
            <div class="layer">
                <span></span>
                <span></span>
                <span></span>
                <span></span>
                <span class="fab fa-instagram"></span>
            </div>
            <div class="text">
                Instagram
            </div>
        </a>
        <a href="#">
            <div class="layer">
                <span></span>
                <span></span>
                <span></span>
                <span></span>
                <span class="fab fa-linkedin-in"></span>
            </div>
            <div class="text">
                Linkedin
            </div>
        </a>
        <a href="#">
            <div class="layer">
                <span></span>
                <span></span>
                <span></span>
                <span></span>
                <span class="fab fa-youtube"></span>
            </div>
            <div class="text">
                YouTube
            </div>
        </a>
    </div>
</body>
</html>

In this HTML, each button link has a unique class (e.g., Facebook, Twitter, Instagram) that we’ll style later in the CSS.

CSS Styling and 3D Effect Animation

Next, we’ll work on the CSS to style these Social Media Buttons. Start by adding styles to give each button a unique colour, background, and hover effect.

@import url('https://fonts.googleapis.com/css?family=Poppins:400,500,600,700&display=swap');
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}
html,
body {
    display: grid;
    height: 100%;
    place-items: center;
    background: #000;
}
.icons {
    display: inline-flex;
}
.icons a {
    margin: 0 25px;
    text-decoration: none;
    color: #fff;
    display: block;
    position: relative;
}
.icons a .layer {
    width: 55px;
    height: 55px;
    transition: transform 0.3s;
}
.icons a:hover .layer {
    transform: rotate(-35deg) skew(20deg);
}
.icons a .layer span {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    border: 1px solid #fff;
    border-radius: 5px;
    transition: all 0.3s;
}
.icons a .layer span.fab {
    font-size: 30px;
    line-height: 55px;
    text-align: center;
}
.icons a:hover .layer span:nth-child(1) {
    opacity: 0.2;
}
.icons a:hover .layer span:nth-child(2) {
    opacity: 0.4;
    transform: translate(5px, -5px);
}
.icons a:hover .layer span:nth-child(3) {
    opacity: 0.6;
    transform: translate(10px, -10px);
}
.icons a:hover .layer span:nth-child(4) {
    opacity: 0.8;
    transform: translate(15px, -15px);
}
.icons a:hover .layer span:nth-child(5) {
    opacity: 1;
    transform: translate(20px, -20px);
}
.icons a:nth-child(1) .layer span,
.icons a:nth-child(1) .text {
    color: #4267B2;
    border-color: #4267B2;
}
.icons a:nth-child(2) .layer span,
.icons a:nth-child(2) .text {
    color: #1DA1F2;
    border-color: #1DA1F2;
}
.icons a:nth-child(3) .layer span,
.icons a:nth-child(3) .text {
    color: #E1306C;
    border-color: #E1306C;
}
.icons a:nth-child(4) .layer span,
.icons a:nth-child(4) .text {
    color: #2867B2;
    border-color: #2867B2;
}
.icons a:nth-child(5) .layer span,
.icons a:nth-child(5) .text {
    color: #ff0000;
    border-color: #ff0000;
}
.icons a:hover:nth-child(1) .layer span {
    box-shadow: -1px 1px 3px #4267B2;
}
.icons a:hover:nth-child(2) .layer span {
    box-shadow: -1px 1px 3px #1DA1F2;
}
.icons a:hover:nth-child(3) .layer span {
    box-shadow: -1px 1px 3px #E1306C;
}
.icons a:hover:nth-child(4) .layer span {
    box-shadow: -1px 1px 3px #2867B2;
}
.icons a:hover:nth-child(5) .layer span {
    box-shadow: -1px 1px 3px #ff0000;
}
.icons a .text {
    position: absolute;
    left: 50%;
    bottom: -5px;
    opacity: 0;
    font-weight: 500;
    transform: translateX(-50%);
    transition: bottom 0.3s ease, opacity 0.3s ease;
}
.icons a:hover .text {
    bottom: -35px;
    opacity: 1;
}

This CSS code styles the Social Media Buttons with colour and text formatting. The::before pseudo-element helps create the 3D hover layer.

Adding 3D Hover Effect Animation

To achieve the 3D layered look, let’s apply a hover effect on each button. When a user hovers over a button, it will appear to lift off the page slightly, adding a shadow for the 3D effect.

When hovering, the button’s background slightly enlarges, and a shadow appears, creating the desired 3D visual effect.

Best Practices for Social Media Buttons

  • Placement: Keep your social media buttons prominent but not intrusive. They’re often most effective in header areas or at the end of posts, where users are likely to consider sharing.
  • Consistency: Ensure that buttons match your site’s design. Use consistent colours and fonts that align with your branding.
  • Encouragement: Use clear calls to action, like “Share this post!” to encourage users to click.

FAQs on Social Media Buttons and 3D Effects

  1. How do Social Media Buttons increase engagement?
  2. These buttons simplify sharing, which can help expand your audience reach.

  3. Can these effects be added without JavaScript?
  4. This tutorial uses only HTML and CSS, making it fast and easy to implement.

  5. What is the benefit of using a 3D hover effect?
  6. The 3D effect captures attention and adds an interactive feel, making buttons more engaging.

Want to Check Username Availability on Social Media?If you’re looking to check username availability on various social media platforms, visit NameChkr to find out!
Read Also

  1. Glassmorphism Login Form in HTML and CSS
    Explore the stylish world of glassmorphism as you create a modern login form using HTML and CSS. This guide breaks down the design process step by step.
  2. Toggle Button using HTML, CSS, and JavaScript
    Discover how to enhance user interaction by creating a sleek toggle button with HTML, CSS, and JavaScript. This tutorial covers everything from structure to styling.
  3. Responsive Cards in HTML and CSS
    Learn how to design eye-catching responsive cards that adapt seamlessly to any device. This guide offers practical tips for achieving stunning layouts.
  4. Build a Google Gemini Chatbot Using HTML, CSS, and JS
    Dive into chatbot development by creating a Google Gemini chatbot with HTML, CSS, and JavaScript. This tutorial will help you understand the basics of interactive forms.

Download the Source Code

To see a live demo or download the complete source code, click the button below:

Are you looking for an elegant, modern, and transparent login form that you can quickly implement using HTML, CSS, and a little JavaScript? This step-by-step guide will walk you through creating a transparent login form design that’s lightweight, responsive, and visually stunning. It’s a great way to offer a sleek user experience while keeping your website fast and SEO-friendly.

What is a Transparent Login Form?

A transparent login form is a visually appealing input form where elements like the background or form fields have reduced opacity, giving a glass-like effect. This design is perfect for modern websites prioritizing minimalism and aesthetics, particularly for login pages, registration forms, and even portfolio or business websites. With just HTML, CSS, and minimal JavaScript for functionality, you can create a login form that stands out and adds a professional touch to your site.

Why Use Transparent Login Forms?

Transparent login forms offer more than just a great look—they also provide a user-friendly interface. This type of design is commonly used across many websites because:

  • They focus on the user input fields while blending beautifully with the background.
  • The design is lightweight, keeping your website’s performance optimized.
  • It’s highly customizable, meaning you can easily change the background, text, and form details to fit your site’s theme.

Using only HTML and CSS, you can achieve a seamless login experience without relying on heavy frameworks, ensuring your website remains responsive and SEO-optimized.

Key Features of the Transparent Login Form

This transparent login form design includes the following:

  • Transparent background that provides a sleek, glass-like appearance.
  • Username and password fields with focus animations for a clean, professional look.
  • Show/hide password toggle functionality using JavaScript for better user experience.
  • Social media icons that can link to popular platforms like Facebook, Twitter, or LinkedIn.
  • Fully responsive design that adapts to different screen sizes, ensuring mobile-friendly accessibility.

Step-by-Step Guide to Create a Transparent Login Form

Step 1: Building the HTML Structure

To start, create a basic HTML structure for the form. The form should contain input fields for the username, password, and a submit button. Here’s an example:

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>Transparent Login Form UI</title>
    <link rel="stylesheet" href="style.css">
   <script src="https://kit.fontawesome.com/a076d05399.js"></script>
  </head>
  <body>
    <div class="bg-img">
      <div class="content">
        <header>Login Form</header>
        <form action="#">
          <div class="field">
            <span class="fa fa-user"></span>
            <input type="text" required placeholder="Email or Phone">
          </div>
          <div class="field space">
            <span class="fa fa-lock"></span>
            <input type="password" class="pass-key" required placeholder="Password">
            <span class="show">SHOW</span>
          </div>
          <div class="pass">
            <a href="#">Forgot Password?</a>
          </div>
          <div class="field">
            <input type="submit" value="LOGIN">
          </div>
        </form>
        <div class="login">Or login with</div>
        <div class="links">
          <div class="facebook">
            <i class="fab fa-facebook-f"><span>Facebook</span></i>
          </div>
          <div class="instagram">
            <i class="fab fa-instagram"><span>Instagram</span></i>
          </div>
        </div>
        <div class="signup">Don't have account?
          <a href="#">Signup Now</a>
        </div>
      </div>
    </div>
  </body>
</html>

Step 2: Styling with CSS

Now, it’s time to make the form look stylish using CSS. You’ll use properties like opacity for the transparent effect and border-radius for smooth edges. Here’s how you can style it:

@import url('https://fonts.googleapis.com/css?family=Montserrat:400,500,600,700|Poppins:400,500&display=swap');
*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
}
.bg-img{
  background: url('bg.jpg');
  height: 100vh;
  background-size: cover;
  background-position: center;
}
.bg-img:after{
  position: absolute;
  content: '';
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: rgba(0,0,0,0.7);
}
.content{
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 999;
  text-align: center;
  padding: 60px 32px;
  width: 370px;
  transform: translate(-50%,-50%);
  background: rgba(255,255,255,0.04);
  box-shadow: -1px 4px 28px 0px rgba(0,0,0,0.75);
}
.content header{
  color: white;
  font-size: 33px;
  font-weight: 600;
  margin: 0 0 35px 0;
  font-family: 'Montserrat',sans-serif;
}
.field{
  position: relative;
  height: 45px;
  width: 100%;
  display: flex;
  background: rgba(255,255,255,0.94);
}
.field span{
  color: #222;
  width: 40px;
  line-height: 45px;
}
.field input{
  height: 100%;
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #222;
  font-size: 16px;
  font-family: 'Poppins',sans-serif;
}
.space{
  margin-top: 16px;
}
.show{
  position: absolute;
  right: 13px;
  font-size: 13px;
  font-weight: 700;
  color: #222;
  display: none;
  cursor: pointer;
  font-family: 'Montserrat',sans-serif;
}
.pass-key:valid ~ .show{
  display: block;
}
.pass{
  text-align: left;
  margin: 10px 0;
}
.pass a{
  color: white;
  text-decoration: none;
  font-family: 'Poppins',sans-serif;
}
.pass:hover a{
  text-decoration: underline;
}
.field input[type="submit"]{
  background: #3498db;
  border: 1px solid #2691d9;
  color: white;
  font-size: 18px;
  letter-spacing: 1px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Montserrat',sans-serif;
}
.field input[type="submit"]:hover{
  background: #2691d9;
}
.login{
  color: white;
  margin: 20px 0;
  font-family: 'Poppins',sans-serif;
}
.links{
  display: flex;
  cursor: pointer;
  color: white;
  margin: 0 0 20px 0;
}
.facebook,.instagram{
  width: 100%;
  height: 45px;
  line-height: 45px;
  margin-left: 10px;
}
.facebook{
  margin-left: 0;
  background: #4267B2;
  border: 1px solid #3e61a8;
}
.instagram{
  background: #E1306C;
  border: 1px solid #df2060;
}
.facebook:hover{
  background: #3e61a8;
}
.instagram:hover{
  background: #df2060;
}
.links i{
  font-size: 17px;
}
i span{
  margin-left: 8px;
  font-weight: 500;
  letter-spacing: 1px;
  font-size: 16px;
  font-family: 'Poppins',sans-serif;
}
.signup{
  font-size: 15px;
  color: white;
  font-family: 'Poppins',sans-serif;
}
.signup a{
  color: #3498db;
  text-decoration: none;
}
.signup a:hover{
  text-decoration: underline;
}

Step 3: Adding JavaScript for Toggle Password Visibility

You can add a show/hide password functionality to improve the form’s usability using JavaScript. This will allow users to toggle the visibility of their password, ensuring ease of use.

<script>
  const pass_field = document.querySelector('.pass-key');
  const showBtn = document.querySelector('.show');
  showBtn.addEventListener('click', function(){
   if(pass_field.type === "password"){
     pass_field.type = "text";
     showBtn.textContent = "HIDE";
     showBtn.style.color = "#3498db";
   }else{
     pass_field.type = "password";
     showBtn.textContent = "SHOW";
     showBtn.style.color = "#222";
   }
  });
</script>

Step 4: Ensuring Responsiveness

Add media queries for different screen sizes to ensure the login form looks great on mobile devices. This will ensure the form adjusts its size and layout based on the device’s width.

@media (max-width: 600px) {
.field input[type="submit"]{
  background: red;
  border: 1px solid #2691d9;
  color: white;
  font-size: 18px;
  letter-spacing: 1px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Montserrat',sans-serif;
}
}
Want to Check Username Availability on Social Media?If you’re looking to check username availability on various social media platforms, visit NameChkr to find out!
Read Also

  1. Glassmorphism Login Form in HTML and CSS
    Explore the stylish world of glassmorphism as you create a modern login form using HTML and CSS. This guide breaks down the design process step by step.
  2. Toggle Button using HTML, CSS, and JavaScript
    Discover how to enhance user interaction by creating a sleek toggle button with HTML, CSS, and JavaScript. This tutorial covers everything from structure to styling.
  3. Responsive Cards in HTML and CSS
    Learn how to design eye-catching responsive cards that adapt seamlessly to any device. This guide offers practical tips for achieving stunning layouts.
  4. Build a Google Gemini Chatbot Using HTML, CSS, and JS
    Dive into chatbot development by creating a Google Gemini chatbot with HTML, CSS, and JavaScript. This tutorial will help you understand the basics of interactive forms.

Conclusion

By following this guide, you now have a beautifully designed Transparent Login Form using HTML, CSS, and JavaScript that’s functional and visually appealing. This login form can easily be customized and integrated into any website, providing a sleek and modern way to handle user authentication.

If you encounter any challenges or want to explore more customization options, feel free to download the complete source code by clicking the button below.

Want to create a cool and sleek vertical card sliding animation for your website with only HTML and CSS? Give a touch of elegance to your website without the clutter of JavaScript! Let’s dive into this comprehensive guide, where we’ll explore how to create a sleek and stylish vertical card slider with smooth animations that require no JavaScript at all. So, let’s experience these smooth animations and modern design, perfect for developers committed to creating fast, adaptable, and SEO-friendly sites.

Whether working on a personal project or building a portfolio, this tutorial will show you how to create a beautiful card slider that performs well across all devices and screens. The best part? It’s entirely built with HTML and CSS, making it easy to implement and maintain.

What is Vertical Card Sliding Animation?

A Vertical Card Sliding Animation is a smooth and modern way to display multiple pieces of content, such as user profiles, testimonials, or products. With this design, several cards slide vertically, one after the other, while maintaining a minimal, clean layout.

This guide will teach you how to build Vertical Card Sliding Animation using only HTML & CSS, focusing on performance and responsiveness. This design helps capture user attention and provides a dynamic display of essential content in a small space.

Why Choose HTML & CSS for Vertical Card Sliding Animation?

There are several reasons to create this animation using only HTML and CSS:

  1. Performance: A CSS-only solution is much lighter than JavaScript-based animations, meaning faster load times and better performance on mobile and desktop devices.
  2. SEO Benefits: Since this animation does not rely on JavaScript, it helps maintain clean, crawlable code, improving your website’s search engine optimization (SEO).
  3. Cross-Browser Compatibility: All modern browsers widely support Pure CSS animations, ensuring a seamless experience for your users.
  4. Ease of Maintenance: A simpler codebase with only HTML and CSS is more effortless to maintain and modify, making it more adaptable to future changes or enhancements.

Focusing on a Vertical Card Sliding Animation using only HTML and CSS will create a visually appealing design while keeping your website efficient and user-friendly.

Key Features of Vertical Card Sliding Animation

Here are the standout features you’ll learn to create in this tutorial:

  • Vertical Sliding Animation: The cards slide up and down smoothly.
  • Hover Effect: When you hover over a card, the animation pauses, allowing users to focus on the content.
  • Fade-In Effect: The central card remains fully visible, while the surrounding cards fade subtlely, adding to the aesthetic.
  • Responsive Design: The card slider will adjust to different screen sizes, ensuring it looks great on mobile, tablet, and desktop devices.
  • Minimalist Layout: The design is clean and modern, making it perfect for any website that values simplicity and user interaction.

Step-by-Step Guide to Creating Vertical Card Sliding Animation Using Only HTML & CSS
Let’s break down how to build this Vertical Card Sliding Animation using only HTML & CSS step by step.

Step 1: Setting Up the HTML Structure

The first step is creating the basic HTML structure for your card slider. This will include profile pictures, names, job titles, and a button for interaction. Here’s the initial HTML:

<!DOCTYPE html>
 
<!-- Coding By abhikesh - abhikesh.com -->
 
<html lang="en">
 
<head>
 
  <meta charset="UTF-8">
 
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
 
  <title>Vertical Card Slider | abhikesh</title>
 
  <link rel="stylesheet" href="style.css">
 
</head>
 
<body>
 
  <div class="wrapper">
 
    <div class="outer">
 
      <div class="card" style="--delay:-1;">
 
        <div class="content">
 
          <div class="img"><img src="images/img-1.jpg" alt=""></div>
 
          <div class="details">
 
            <span class="name">Rahul Kapoor</span>
 
            <p>Frontend Developer</p>
 
          </div>
 
        </div>
 
        <a href="#">Follow</a>
 
      </div>
 
      <div class="card" style="--delay:0;">
 
        <div class="content">
 
          <div class="img"><img src="images/img-2.jpg" alt=""></div>
 
          <div class="details">
 
            <span class="name">Romiyo Neil</span>
 
            <p>YouTuber & Blogger</p>
 
          </div>
 
        </div>
 
        <a href="#">Follow</a>
 
      </div>
 
      <div class="card" style="--delay:1;">
 
        <div class="content">
 
          <div class="img"><img src="images/img-3.jpg" alt=""></div>
 
          <div class="details">
 
            <span class="name">Jasmine Carter</span>
 
            <p>Freelancer & Vlogger</p>
 
          </div>
 
        </div>
 
        <a href="#">Follow</a>
 
      </div>
 
      <div class="card" style="--delay:2;">
 
        <div class="content">
 
          <div class="img"><img src="images/img-4.jpg" alt=""></div>
 
          <div class="details">
 
            <span class="name">Justin Chung</span>
 
            <p>Backend Developer</p>
 
          </div>
 
        </div>
 
        <a href="#">Follow</a>
 
      </div>
 
      <div class="card" style="--delay:2;">
 
        <div class="content">
 
          <div class="img"><img src="images/img-5.jpg" alt=""></div>
 
          <div class="details">
 
            <span class="name">Adrina Calvo</span>
 
            <p>Teacher & Advertiser</p>
 
          </div>
 
        </div>
 
        <a href="#">Follow</a>
 
      </div>
 
    </div>
 
  </div>
 
</body>
 
</html>

This simple HTML provides the foundation for your Vertical Card Sliding Animation using only HTML & CSS.

Step 2: Applying CSS Styling and Animation

Next, let’s style the card slider using CSS. We’ll use Flexbox for layout, and CSS animations will create the vertical sliding effect.

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap');
 
*{
 
  margin: 0;
 
  padding: 0;
 
  box-sizing: border-box;
 
  font-family: "Poppins", sans-serif;
 
}
 
body{
 
  width: 100%;
 
  height: 100vh;
 
  display: flex;
 
  align-items: center;
 
  justify-content: center;
 
  background: linear-gradient(to bottom, #bea2e7 0%, #86b7e7 100%);
 
}
 
.wrapper .outer{
 
  display: flex;
 
  align-items: center;
 
  justify-content: center;
 
}
 
.wrapper .card{
 
  background: #fff;
 
  width: 430px;
 
  display: flex;
 
  align-items: center;
 
  padding: 20px;
 
  opacity: 0;
 
  pointer-events: none;
 
  position: absolute;
 
  justify-content: space-between;
 
  border-radius: 100px 20px 20px 100px;
 
  box-shadow: 0px 10px 15px rgba(0,0,0,0.1);
 
  animation: animate 15s linear infinite;
 
  animation-delay: calc(3s * var(--delay));
 
}
 
.outer:hover .card{
 
  animation-play-state: paused;
 
}
 
.wrapper .card:last-child{
 
  animation-delay: calc(-3s * var(--delay));
 
}
 
@keyframes animate {
 
  0%{
 
    opacity: 0;
 
    transform: translateY(100%) scale(0.5);
 
  }
 
  5%, 20%{
 
    opacity: 0.4;
 
    transform: translateY(100%) scale(0.7);
 
  }
 
  25%, 40%{
 
    opacity: 1;
 
    pointer-events: auto;
 
    transform: translateY(0%) scale(1);
 
  }
 
  45%, 60%{
 
    opacity: 0.4;
 
    transform: translateY(-100%) scale(0.7);
 
  }
 
  65%, 100%{
 
    opacity: 0;
 
    transform: translateY(-100%) scale(0.5);
 
  }
 
}
 
.card .content{
 
  display: flex;
 
  align-items: center;
 
}
 
.wrapper .card .img{
 
  height: 90px;
 
  width: 90px;
 
  position: absolute;
 
  left: -5px;
 
  background: #fff;
 
  border-radius: 50%;
 
  padding: 5px;
 
  box-shadow: 0px 0px 5px rgba(0,0,0,0.2);
 
}
 
.card .img img{
 
  height: 100%;
 
  width: 100%;
 
  border-radius: 50%;
 
  object-fit: cover;
 
}
 
.card .details{
 
  margin-left: 80px;
 
}
 
.details span{
 
  font-weight: 600;
 
  font-size: 18px;
 
}
 
.card a{
 
  text-decoration: none;
 
  padding: 7px 18px;
 
  border-radius: 25px;
 
  color: #fff;
 
  background: linear-gradient(to bottom, #bea2e7 0%, #86b7e7 100%);
 
  transition: all 0.3s ease;
 
}
 
.card a:hover{
 
  transform: scale(0.94);
 
}

This CSS will create the vertical sliding animation that brings the cards in and out of view.

Step 3: Making the Design Responsive with Media Queries

Use media queries for responsive design to ensure that your card slider looks perfect on all devices. This allows the slider to adapt to smaller screens.

@media (max-width: 600px) {
 
  .card a {
 
    text-decoration: none;
 
    padding: 7px 18px;
 
    border-radius: 25px;
 
    color: red;
 
    background: linear-gradient(to bottom, #bea2e7 0%, #86b7e7 100%);
 
    transition: all 0.3s ease;
 
  }
 
  .card a:hover {
 
    transform: scale(0.94);
 
  }
 
}

Benefits of Using Pure HTML & CSS for Animations

Why should you opt for a solution using only HTML and CSS? Here are some key reasons:

  • No JavaScript Dependency: You don’t need to load additional libraries, reducing page weight and load times.
  • Improved SEO: Clean HTML and CSS are more search engine friendly than JavaScript-heavy solutions.
  • Accessibility: CSS animations are inherently accessible and work across various devices and browsers.
  • Faster Development Time: With fewer dependencies, the development process is more rapid, and debugging is simpler.

Utilizing only HTML and CSS for this vertical sliding card animation ensures your design is lightweight, high-performing, and easy to maintain.

Want to Check Username Availability on Social Media?If you’re looking to check username availability on various social media platforms, visit NameChkr to find out!
Read Also

  1. Glassmorphism Login Form in HTML and CSS
    Explore the stylish world of glassmorphism as you create a modern login form using HTML and CSS. This guide breaks down the design process step by step.
  2. Toggle Button using HTML, CSS, and JavaScript
    Discover how to enhance user interaction by creating a sleek toggle button with HTML, CSS, and JavaScript. This tutorial covers everything from structure to styling.
  3. Responsive Cards in HTML and CSS
    Learn how to design eye-catching responsive cards that adapt seamlessly to any device. This guide offers practical tips for achieving stunning layouts.
  4. Build a Google Gemini Chatbot Using HTML, CSS, and JS
    Dive into chatbot development by creating a Google Gemini chatbot with HTML, CSS, and JavaScript. This tutorial will help you understand the basics of interactive forms.

Conclusion

Creating a Vertical Card Sliding Animation using only HTML and CSS is an excellent way to add an engaging and interactive element to your website. This design is perfect for portfolios, business websites, and personal blogs. Avoiding JavaScript and relying solely on CSS animations enhances user experience and SEO performance while maintaining a simple and clean codebase.

Feel free to customize the design further to suit your project needs. If you encounter any difficulties or want to access the complete source code, don’t hesitate to download it using the link below.

Download the Source Code

Need the complete source code for this Vertical Card Sliding Animation using only HTML & CSS? Click the button below to get the full package and start building your interactive card slider today!

Are you looking for a simple yet stylish animated profile card design using only HTML and CSS? You’re in the right place! In this blog post, we’ll walk through creating an animated profile card that showcases a person’s profile details and some sleek animation effects. This design is perfect for portfolio websites, personal branding pages, or anywhere you want to present an individual’s identity confidently.

Whether you’re a beginner or an experienced developer, this tutorial will help you build a functional and aesthetically pleasing profile card. And the best part? No JavaScript is needed—everything is achieved with pure HTML and CSS!

What is a Profile Card?

A profile card is a visual representation of a person’s basic information. It typically includes the individual’s name, job title, social media links, and sometimes a photo. This compact way to present essential details about someone is commonly used on personal websites, business platforms, or portfolio pages.

Why Use HTML & CSS for Profile Cards?

Using only HTML and CSS for your profile card design ensures the code remains lightweight, fast to load, and easy to manage. No heavy JavaScript libraries are required, making your website more accessible and SEO-friendly.

With just HTML for structure and CSS for styling, you can create a clean and professional-looking profile card that looks great and performs well across all devices.

Features of Our Animated Profile Card

This animated profile card design includes the following features:

  • A visually appealing layout with a picture, name, job title, and social media icons.
  • A button that toggles the profile card’s visibility with sliding animations.
  • Smooth animations for social media icons when hovered.
  • Flexible layout optimized for all screen sizes.

Now, let’s explore the steps to bring this design to life!

Step-by-Step Guide to Building the Animated Profile Card

Step 1: Building the HTML Structure

The straightforward HTML structure includes elements like the profile image, name, job title, social media icons, and a button. Here’s how you can structure it:

<!DOCTYPE html>
<!-- Website - www.abhikesh.com -->
<html lang="en" dir="ltr">
<head>
  <meta charset="UTF-8" />
  <title>Animated Profile Card HTML CSS | CodingNepal</title>
  <link rel="stylesheet" href="style.css" />
  <script src="https://kit.fontawesome.com/a076d05399.js"></script>
</head>
<body>
  <div class="main-box">
    <div class="content">
      <input type="checkbox" id="check" />
      <label class="box" for="check">
        <div class="share">SHARE</div>
        <div class="cancel">CANCEL</div>
      </label>
      <div class="image-box">
        <img src="james.jpeg" alt="" />
        <div class="about">
          <div class="details">
            <div class="name">Abhikesh</div>
            <div class="job">Devoloper | Designer</div>
            <div class="icon">
              <a href="#"><i class="fab fa-facebook-f"></i></a>
              <a href="#"><i class="fab fa-twitter"></i></a>
              <a href="#"><i class="fab fa-instagram"></i></a>
              <a href="#"><i class="fab fa-youtube"></i></a>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</body>
</html>

Step 2: Styling the Profile Card with CSS

Next, we’ll use CSS to style the card. We’ll apply Flexbox to centre the content and give the profile card a sleek look with modern design elements.

@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap");
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}
body {
  background: #3498db;
}
.main-box {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  height: 550px;
  text-align: center;
}
.main-box .content {
  position: relative;
  height: 100%;
  width: 100%;
}
.content .box {
  position: absolute;
  height: 50px;
  width: 100%;
  left: 0;
  bottom: 0;
  border-radius: 25px;
  cursor: pointer;
}
.share,
.cancel {
  position: absolute;
  height: 100%;
  width: 100%;
  left: 0;
  top: 0;
  font-size: 20px;
  font-weight: 600;
  color: #2980b9;
  line-height: 50px;
  background: #fff;
  letter-spacing: 1px;
  border-radius: 25px;
  opacity: 0;
  transition: all 0.3s ease;
}
.content .box .share {
  opacity: 1;
}
#check:checked ~ .box .share {
  opacity: 0;
}
#check:checked ~ .box .cancel {
  opacity: 1;
}
.content .image-box {
  position: absolute;
  height: 450px;
  width: 100%;
  bottom: 130px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  padding: 10px;
  border-radius: 25px;
  transition: all 0.4s ease;
}
#check:checked ~ .image-box {
  bottom: 70px;
}
#check {
  display: none;
}
.image-box::before {
  position: absolute;
  content: "";
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  height: 30px;
  width: 30px;
  background: #fff;
  z-index: -1;
}
.image-box img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  border-radius: 26px;
}
.image-box .about {
  position: absolute;
  background: rgba(0, 0, 0, 0.5);
  height: 100%;
  width: 100%;
  left: 0;
  top: 0;
  border-radius: 25px;
  padding: 20px;
  text-align: center;
  opacity: 0;
  transition: all 0.3s ease;
}
#check:checked ~ .image-box .about {
  opacity: 1;
}
.about .details {
  position: absolute;
  width: 100%;
  left: 0;
  bottom: 35px;
}
.details .name,
.job {
  font-size: 18px;
  font-weight: 500;
  color: #fff;
}

Step 3: Adding Animations

CSS animations bring life to your profile card. We’ll add simple sliding and hover effects for the social media icons and use a button to control the visibility of the profile card.

.details .icon i {
  font-size: 20px;
  color: #fff;
  height: 45px;
  width: 45px;
  line-height: 43px;
  border-radius: 50%;
  border: 2px solid #fff;
  margin: 14px 5px;
  transition: all 0.3s ease;
}
.details .icon i:hover {
  transform: scale(0.95);
}

Step 4: Making the Profile Card Responsive
You’ll want to add media queries to ensure your profile card looks great on all devices. This will allow the card to resize and adjust its layout based on the screen size.

@media screen and (max-width: 768px) {
.image-box .about {
  position: absolute;
  background: rgba(0, 0, 0, 0.5);
  height: 100%;
  width: 100%;
  left: 0;
  top: 0;
  border-radius: 25px;
  padding: 20px;
  text-align: center;
  opacity: 0;
  transition: all 0.3s ease;
}
}
Want to Check Username Availability on Social Media?If you’re looking to check username availability on various social media platforms, visit NameChkr to find out!
Read Also

  1. Glassmorphism Login Form in HTML and CSS
    Explore the stylish world of glassmorphism as you create a modern login form using HTML and CSS. This guide breaks down the design process step by step.
  2. Toggle Button using HTML, CSS, and JavaScript
    Discover how to enhance user interaction by creating a sleek toggle button with HTML, CSS, and JavaScript. This tutorial covers everything from structure to styling.
  3. Responsive Cards in HTML and CSS
    Learn how to design eye-catching responsive cards that adapt seamlessly to any device. This guide offers practical tips for achieving stunning layouts.
  4. Build a Google Gemini Chatbot Using HTML, CSS, and JS
    Dive into chatbot development by creating a Google Gemini chatbot with HTML, CSS, and JavaScript. This tutorial will help you understand the basics of interactive forms.

Conclusion

Building an animated profile card using only HTML and CSS is a great way to add interactive, visually appealing elements to your website. By keeping it simple, lightweight, and responsive, you can ensure that your profile card performs well on all devices.

Whether using this card for your portfolio, business site, or personal blog, you now have a versatile and engaging way to display your profile information.

Download the Source Code

If you want to dive deeper or face any issues while creating the animated profile card, please download the complete source code below.

If you’re interested in learning how to create a clean and efficient Mega and Dropdown Menu using only HTML & CSS, you’re in the right place! In this tutorial, we will walk through how to build a fully functional mega and dropdown menu navigation bar using just HTML and CSS—no JavaScript needed!

Mega and Dropdown Menu are becoming increasingly popular on websites with complex structures or multiple categories. In contrast, a dropdown menu is a simpler form of navigation. Combining both in a responsive menu ensures that your visitors enjoy a smooth user experience, regardless of their device.

Whether you’re a beginner or a seasoned developer, this guide will help you design a visually appealing, responsive menu for your site. We’ll explore the essential HTML structure, CSS styling, and how to ensure your navigation bar looks great on all devices.

What is a Responsive Mega and Dropdown Menu?

A Responsive Mega and Dropdown Menu is a website navigation system that combines the simplicity of a dropdown menu with the functionality of a mega menu. A dropdown menu displays a list of items when you hover or click on a parent link. In contrast, a mega menu presents multiple columns of links and additional content like categories or product lists.

When built with pure HTML and CSS, these menus become lightweight, fast-loading, and compatible across browsers without needing JavaScript.

Benefits of Using Only HTML & CSS

Building a Responsive Mega and Dropdown Menu using only HTML and CSS offers several advantages:

  • Performance: HTML and CSS menus are lightweight and don’t require heavy JavaScript libraries, ensuring fast load times for your website.
  • SEO: Search engines can easily crawl and index HTML content, improving your website’s visibility.
  • Accessibility: HTML and CSS menus work seamlessly on most devices and assistive technologies.
  • Responsiveness: CSS media queries allow you to create a fully responsive menu for mobile devices.

Now, let’s get into how to create a Responsive Mega Menu and Dropdown Menu using only HTML & CSS step by step.

Step-by-Step Guide to Building a Responsive Mega and Dropdown Menu with Just HTML & CSS
Creating a Responsive Mega and Dropdown Menu is straightforward if you break it down into steps. Here’s the complete process:

Step 1: Building the HTML Structure

To begin, we will establish the foundational structure of the mega and dropdown menu with HTML. This will include a navbar containing links, dropdown items, and mega menu sections. Below is a sample code snippet to help you get started:

<!DOCTYPE html>
<!-- Created By abhikesh - www.abhikesh.com -->
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Responsive Mega Menu | abhikesh</title>
    <link rel="stylesheet" href="style.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"/>
</head>
<body>
  <nav>
    <div class="wrapper">
      <div class="logo"><a href="#">Abhikesh</a></div>
      <input type="radio" name="slider" id="menu-btn">
      <input type="radio" name="slider" id="close-btn">
      <ul class="nav-links">
        <label for="close-btn" class="btn close-btn"><i class="fas fa-times"></i></label>
        <li><a href="#">Home</a></li>
        <li><a href="#">About</a></li>
        <li>
          <a href="#" class="desktop-item">Dropdown Menu</a>
          <input type="checkbox" id="showDrop">
          <label for="showDrop" class="mobile-item">Dropdown Menu</label>
          <ul class="drop-menu">
            <li><a href="#">Drop menu 1</a></li>
            <li><a href="#">Drop menu 2</a></li>
            <li><a href="#">Drop menu 3</a></li>
            <li><a href="#">Drop menu 4</a></li>
          </ul>
        </li>
        <li>
          <a href="#" class="desktop-item">Mega Menu</a>
          <input type="checkbox" id="showMega">
          <label for="showMega" class="mobile-item">Mega Menu</label>
          <div class="mega-box">
            <div class="content">
              <div class="row">
                <img src="img.jpg" alt="">
              </div>
              <div class="row">
                <header>Design Services</header>
                <ul class="mega-links">
                  <li><a href="#">Graphics</a></li>
                  <li><a href="#">Vectors</a></li>
                  <li><a href="#">Business cards</a></li>
                  <li><a href="#">Custom logo</a></li>
                </ul>
              </div>
              <div class="row">
                <header>Email Services</header>
                <ul class="mega-links">
                  <li><a href="#">Personal Email</a></li>
                  <li><a href="#">Business Email</a></li>
                  <li><a href="#">Mobile Email</a></li>
                  <li><a href="#">Web Marketing</a></li>
                </ul>
              </div>
              <div class="row">
                <header>Security services</header>
                <ul class="mega-links">
                  <li><a href="#">Site Seal</a></li>
                  <li><a href="#">VPS Hosting</a></li>
                  <li><a href="#">Privacy Seal</a></li>
                  <li><a href="#">Website design</a></li>
                </ul>
              </div>
            </div>
          </div>
        </li>
        <li><a href="#">Feedback</a></li>
      </ul>
      <label for="menu-btn" class="btn menu-btn"><i class="fas fa-bars"></i></label>
    </div>
  </nav>
  <div class="body-text">
    <div class="title">Responsive Dropdown and Mega Menu</div>
    <div class="sub-title">using only HTML & CSS</div>
  </div>
</body>
</html>

Step 2: Styling the Mega Menu with CSS

Next, we’ll style the navigation bar, dropdown menu, and mega menu using CSS. The menu will have a modern look with a clean design, suitable for any professional website. Below is an example of CSS styling:

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap');
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}
nav {
  position: fixed;
  z-index: 99;
  width: 100%;
  background: #242526;
}
nav .wrapper {
  position: relative;
  max-width: 1300px;
  padding: 0px 30px;
  height: 70px;
  line-height: 70px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wrapper .logo a {
  color: #f2f2f2;
  font-size: 30px;
  font-weight: 600;
  text-decoration: none;
}
.wrapper .nav-links {
  display: inline-flex;
}
.nav-links li {
  list-style: none;
}
.nav-links li a {
  color: #f2f2f2;
  text-decoration: none;
  font-size: 18px;
  font-weight: 500;
  padding: 9px 15px;
  border-radius: 5px;
  transition: all 0.3s ease;
}
.nav-links li a:hover {
  background: #3A3B3C;
}
.nav-links .mobile-item {
  display: none;
}
.nav-links .drop-menu {
  position: absolute;
  background: #242526;
  width: 180px;
  line-height: 45px;
  top: 85px;
  opacity: 0;
  visibility: hidden;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}
.nav-links li:hover .drop-menu,
.nav-links li:hover .mega-box {
  transition: all 0.3s ease;
  top: 70px;
  opacity: 1;
  visibility: visible;
}
.drop-menu li a {
  width: 100%;
  display: block;
  padding: 0 0 0 15px;
  font-weight: 400;
  border-radius: 0px;
}
.mega-box {
  position: absolute;
  left: 0;
  width: 100%;
  padding: 0 30px;
  top: 85px;
  opacity: 0;
  visibility: hidden;
}
.mega-box .content {
  background: #242526;
  padding: 25px 20px;
  display: flex;
  width: 100%;
  justify-content: space-between;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}
.mega-box .content .row {
  width: calc(25% - 30px);
  line-height: 45px;
}
.content .row img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.content .row header {
  color: #f2f2f2;
  font-size: 20px;
  font-weight: 500;
}
.content .row .mega-links {
  margin-left: -40px;
  border-left: 1px solid rgba(255, 255, 255, 0.09);
}
.row .mega-links li {
  padding: 0 20px;
}
.row .mega-links li a {
  padding: 0px;
  padding: 0 20px;
  color: #d9d9d9;
  font-size: 17px;
  display: block;
}
.row .mega-links li a:hover {
  color: #f2f2f2;
}
.wrapper .btn {
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: none;
}
.wrapper .btn.close-btn {
  position: absolute;
  right: 30px;
  top: 10px;
}
nav input {
  display: none;
}
.body-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  text-align: center;
  padding: 0 30px;
}
.body-text div {
  font-size: 45px;
  font-weight: 600;
}
Step 3: Adding Responsiveness
To make our Responsive Mega and Dropdown Menu adapt to different screen sizes, we’ll use CSS media queries. This ensures the menu looks good on both desktop and mobile devices. Here’s how to do it:
@media screen and (max-width: 970px) {
  .wrapper .btn {
    display: block;
  }
  .wrapper .nav-links {
    position: fixed;
    height: 100vh;
    width: 100%;
    max-width: 350px;
    top: 0;
    left: -100%;
    background: #242526;
    display: block;
    padding: 50px 10px;
    line-height: 50px;
    overflow-y: auto;
    box-shadow: 0px 15px 15px rgba(0, 0, 0, 0.18);
    transition: all 0.3s ease;
  }
  /* custom scroll bar */
  ::-webkit-scrollbar {
    width: 10px;
  }
  ::-webkit-scrollbar-track {
    background: #242526;
  }
  ::-webkit-scrollbar-thumb {
    background: #3A3B3C;
  }
  #menu-btn:checked~.nav-links {
    left: 0%;
  }
  #menu-btn:checked~.btn.menu-btn {
    display: none;
  }
  #close-btn:checked~.btn.menu-btn {
    display: block;
  }
  .nav-links li {
    margin: 15px 10px;
  }
  .nav-links li a {
    padding: 0 20px;
    display: block;
    font-size: 20px;
  }
  .nav-links .drop-menu {
    position: static;
    opacity: 1;
    top: 65px;
    visibility: visible;
    padding-left: 20px;
    width: 100%;
    max-height: 0px;
    overflow: hidden;
    box-shadow: none;
    transition: all 0.3s ease;
  }
  #showDrop:checked~.drop-menu,
  #showMega:checked~.mega-box {
    max-height: 100%;
  }
  .nav-links .desktop-item {
    display: none;
  }
  .nav-links .mobile-item {
    display: block;
    color: #f2f2f2;
    font-size: 20px;
    font-weight: 500;
    padding-left: 20px;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
  }
  .nav-links .mobile-item:hover {
    background: #3A3B3C;
  }
  .drop-menu li {
    margin: 0;
  }
  .drop-menu li a {
    border-radius: 5px;
    font-size: 18px;
  }
  .mega-box {
    position: static;
    top: 65px;
    opacity: 1;
    visibility: visible;
    padding: 0 20px;
    max-height: 0px;
    overflow: hidden;
    transition: all 0.3s ease;
  }
  .mega-box .content {
    box-shadow: none;
    flex-direction: column;
    padding: 20px 20px 0 20px;
  }
  .mega-box .content .row {
    width: 100%;
    margin-bottom: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  .mega-box .content .row:nth-child(1),
  .mega-box .content .row:nth-child(2) {
    border-top: 0px;
  }
  .content .row .mega-links {
    border-left: 0px;
    padding-left: 15px;
  }
  .row .mega-links li {
    margin: 0;
  }
  .content .row header {
    font-size: 19px;
  }
}

With these media queries, the navigation menu will stack vertically on smaller screens, and the mega menu will adjust to fit the width of the screen.

Want to Check Username Availability on Social Media?If you’re looking to check username availability on various social media platforms, visit NameChkr to find out!
Read Also

  1. Glassmorphism Login Form in HTML and CSS
    Explore the stylish world of glassmorphism as you create a modern login form using HTML and CSS. This guide breaks down the design process step by step.
  2. Toggle Button using HTML, CSS, and JavaScript
    Discover how to enhance user interaction by creating a sleek toggle button with HTML, CSS, and JavaScript. This tutorial covers everything from structure to styling.
  3. Responsive Cards in HTML and CSS
    Learn how to design eye-catching responsive cards that adapt seamlessly to any device. This guide offers practical tips for achieving stunning layouts.
  4. Build a Google Gemini Chatbot Using HTML, CSS, and JS
    Dive into chatbot development by creating a Google Gemini chatbot with HTML, CSS, and JavaScript. This tutorial will help you understand the basics of interactive forms.

Conclusion

Building a Responsive Mega and Dropdown Menu using only HTML and CSS is a great way to enhance your website’s navigation without relying on JavaScript. This approach provides a lightweight, fast-loading solution that is both accessible and SEO-friendly. You now have a responsive, clean, and professional menu that adapts seamlessly across different screen sizes.

If you run into any issues while coding or need further guidance, feel free to download the source code below.

Download Source Code

To get the full source code for this Responsive Mega and Dropdown Menu using only HTML & CSS, click the button below:

Hey there! Welcome to our blog! Today, we’re diving into an exciting project that’s not only fun but also visually stunning: creating a sleek Glassmorphism Calculator using just HTML and CSS. If you’re looking to spruce up your web design skills, you’re in the right place!

Understanding Glassmorphism Calculator

Before we jump into the fun stuff, let’s chat a bit about glassmorphism calculator. This design trend is all about that frosted glass effect that feels so modern and fresh. Imagine creating an interface that not only works well but also looks great—it’s like the icing on the cake for your web projects!

Setting Up the Project

So, let’s get started! First things first, we’ll need to set up our project. Don’t worry; it’s super easy!

  1. Create a new folder for your project.
  2. Inside that folder, make two files: index.html and style.css.

Features of Our Glassmorphism Calculator

Now, let’s talk about what our Glassmorphism Calculator will do. Here are some cool features we’ll implement:

  • A visually appealing interface that draws users in with its glassy effect.
  • Basic arithmetic operations: addition, subtraction, multiplication, and division—everything you need for those everyday calculations.
  • Responsive design that looks fabulous on any device, so your calculator is ready to go wherever you are.

Building the HTML Structure

Let’s begin by crafting the HTML structure for our calculator. Below is the code that forms the basic layout:

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <!-- Website - www.abhikesh.com -->
  <head>
    <meta charset="UTF-8" />
    <title>Glassmorphism Calculator HTML CSS JavaScript | CodingNepal</title>
    <link rel="stylesheet" href="style.css" />
  </head>
  <body>
    <div class="bubbles">
      <span class="one"></span>
      <span class="two"></span>
      <span class="three"></span>
      <span class="four"></span>
      <span class="five"></span>
      <span class="six"></span>
      <span class="seven"></span>
      <span class="seven"></span>
    </div>
    <div class="bubbles">
      <span class="one"></span>
      <span class="two"></span>
      <span class="three"></span>
      <span class="four"></span>
      <span class="five"></span>
      <span class="six"></span>
      <span class="seven"></span>
      <span class="seven"></span>
    </div>
    <div class="bubbles">
      <span class="one"></span>
      <span class="two"></span>
      <span class="three"></span>
      <span class="four"></span>
      <span class="five"></span>
      <span class="six"></span>
      <span class="seven"></span>
      <span class="seven"></span>
    </div>
    <div class="bubbles">
      <span class="one"></span>
      <span class="two"></span>
      <span class="three"></span>
      <span class="four"></span>
      <span class="five"></span>
      <span class="six"></span>
      <span class="seven"></span>
      <span class="seven"></span>
    </div>
    <div class="container">
      <form action="#" name="forms">
        <input type="text" name="answer" />
        <div class="buttons">
          <input type="button" value="AC" onclick="forms.answer.value = ''" />
          <input type="button" value="DEL" onclick="forms.answer.value = forms.answer.value.substr(0 , forms.answer.value.length -1)" />
          <input type="button" value="%" onclick="forms.answer.value += '%'" />
          <input type="button" value="/" onclick="forms.answer.value += '/'" />
        </div>
        <div class="buttons">
          <input type="button" value="7" onclick="forms.answer.value += '7'" />
          <input type="button" value="8" onclick="forms.answer.value += '8'" />
          <input type="button" value="9" onclick="forms.answer.value += '9'" />
          <input type="button" value="*" onclick="forms.answer.value += '*'" />
        </div>
        <div class="buttons">
          <input type="button" value="4" onclick="forms.answer.value += '4'" />
          <input type="button" value="5" onclick="forms.answer.value += '5'" />
          <input type="button" value="6" onclick="forms.answer.value += '6'" />
          <input type="button" value="-" onclick="forms.answer.value += '-'" />
        </div>
        <div class="buttons">
          <input type="button" value="1" onclick="forms.answer.value += '1'" />
          <input type="button" value="2" onclick="forms.answer.value += '2'" />
          <input type="button" value="3" onclick="forms.answer.value += '3'" />
          <input type="button" value="+" onclick="forms.answer.value += '+'" />
        </div>
        <div class="buttons">
          <input type="button" value="0" onclick="forms.answer.value += '0'" />
          <input type="button" value="00" onclick="forms.answer.value += '00'" />
          <input type="button" value="." onclick="forms.answer.value += '.'" />
          <input type="button" value="=" onclick="forms.answer.value = eval(forms.answer.value)" />
        </div>
      </form>
    </div>
  </body>
</html>

Explanation of the HTML Code

  • The <div class=”bubbles”> contains several <span> elements that create animated bubbles, giving a dynamic feel to the background.
  • The <div class=”container”> holds the calculator layout, including an input field for the calculations and various buttons for user interaction.

Styling with CSS

Now, let’s style our calculator to give it that beautiful glass morphism effect. Here’s how the CSS looks:

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap');
*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins',sans-serif;
}
body{
  height: 100vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(#2196f3 , #e91e63);
}
.bubbles{
  position: absolute;
  bottom: -120px;
  display: flex;
  flex-wrap: wrap;
  margin-top: 70px;
  width: 100%;
  justify-content: space-around;
}
.bubbles span{
  height: 60px;
  width: 60px;
  background: rgba(255, 255, 255, 0.1);
  animation: move 10s linear infinite;
  position: relative;
  overflow: hidden;
}
@keyframes move {
  100%{
    transform: translateY(-100vh);
  }
}
.bubbles span.one{
  animation-delay: 2.2s;
  transform: scale(2.15)
}
.bubbles span.two{
  animation-delay: 3.5s;
  transform: scale(1.55);
}
.bubbles span.three{
  animation-delay: 0.2s;
  transform: scale(0.35);
}
.bubbles span.four{
  animation-delay: 6s;
  transform: scale(2.15);
}
.bubbles span.five{
  animation-delay: 7s;
  transform: scale(0.5);
}
.bubbles span.six{
  animation-delay: 4s;
  transform: scale(2.5);
}
.bubbles span.seven{
  animation-delay: 3;
  transform: scale(1.5);
}
.bubbles span:before{
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 60px;
  width: 40%;
  transform: skew(45deg) translateX(150px);
  background: rgba(255, 255, 255, 0.15);
  animation: mirror 3s linear infinite;
}
@keyframes mirror {
  100%{
    transform: translateX(-450px);
  }
}
.bubbles span.one:before{
  animation-delay: 1.5s;
}
.bubbles span.two:before{
  animation-delay: 3.5s;
}
.bubbles span.three:before{
  animation-delay: 2.5s;
}
.bubbles span.four:before{
  animation-delay: 7.5s;
}
.bubbles span.five:before{
  animation-delay: 4.5s;
}
.bubbles span.six:before{
  animation-delay: 0.5s;
}
.bubbles span.seven:before{
  animation-delay: 6s;
}
.container{
  z-index: 12;
  width: 420px;
  padding: 15px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  border-left: 1px solid rgba(255, 255, 255, 0.5);
}
.container input[type="text"]{
  width: 100%;
  height: 100px;
  margin: 0 3px;
  outline: none;
  border: none;
  color: #fff;
  font-size: 30px;
  text-align: right;
  padding-right: 10px;
  background: transparent;
}
.container input[type="button"]{
  height: 75px;
  color: #fff;
  width: calc(100% / 4 - 5px);
  background: transparent;
  border-radius: 12px;
  margin-top: 15px;
  outline: none;
  border: none;
  font-size: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.container input[type="button"]:hover{
  background: rgba(255, 255, 255, 0.1);
}

Explanation of the CSS Code

The CSS file starts with an import statement to include the Poppins font from Google Fonts.

  • The body element is styled with a vibrant gradient background, ensuring a visually appealing backdrop for the calculator.
  • The .container class applies the glass morphism effect with a transparent background and rounded edges, along with subtle shadows for depth.
Want to Check Username Availability on Social Media?If you’re looking to check username availability on various social media platforms, visit NameChkr to find out!
Read Also

  1. Glassmorphism Login Form in HTML and CSS
    Explore the stylish world of glassmorphism as you create a modern login form using HTML and CSS. This guide breaks down the design process step by step.
  2. Toggle Button using HTML, CSS, and JavaScript
    Discover how to enhance user interaction by creating a sleek toggle button with HTML, CSS, and JavaScript. This tutorial covers everything from structure to styling.
  3. Responsive Cards in HTML and CSS
    Learn how to design eye-catching responsive cards that adapt seamlessly to any device. This guide offers practical tips for achieving stunning layouts.
  4. Build a Google Gemini Chatbot Using HTML, CSS, and JS
    Dive into chatbot development by creating a Google Gemini chatbot with HTML, CSS, and JavaScript. This tutorial will help you understand the basics of interactive forms.

Conclusion

Congratulations! You’ve just created a beautiful Glassmorphism Calculator using only HTML and CSS. This project showcases not only your coding skills but also your ability to implement modern design trends effectively.

Feel free to experiment with the code, tweak the styles, and make it your own. The beauty of web development lies in the endless possibilities for customization!

Download Source Code

If you want to get your hands on the full source code for this glass morphism calculator, simply click the button below:

Z-Index Transitions: Enhance Your Images with CSS

In this tutorial, we’ll guide you through creating Z-Index transitions, an interactive effect on images using only CSS. This approach is perfect for web developers looking to enhance user engagement by adding dynamic visual effects to images. By utilizing CSS alone, you can create seamless transitions that add depth to your design and improve the user experience without the need for JavaScript.

Whether you’re a beginner or an experienced developer, you’ll find value in learning how to implement Z-Index transitions on your website. Not only do these effects provide a professional look, but they also keep your site lightweight and fast. In this step-by-step guide, you’ll discover just how easy it is to create this eye-catching effect using only HTML and CSS.

What is a Z-Index Transition?

Z-Index transitions are a CSS effect that allows specific elements, such as images or cards, to layer over one another in a smooth and visually appealing manner. This technique is widely used in image galleries, product cards, and various designs where visual hierarchy plays a key role in user interaction.

Why Master Z-Index Transitions?

Mastering Z-Index transitions offers several advantages:

  • Enhances User Interaction: This technique adds a dynamic and engaging visual effect to your website.
  • Lightweight Design: Since no JavaScript is needed, you can ensure faster load times.
  • Improves SEO: A faster, cleaner website contributes to better rankings on search engines.
  • Responsive and Accessible: When implemented correctly, these transitions work beautifully across all devices.
How to Create Z-Index Transitions on Images with CSS

Here’s a step-by-step guide to building this visually appealing feature using only HTML and CSS.

Set Up Your Basic HTML Structure

Start by creating the structure of your HTML, where each image or card will have its section. Below is an example of how to set up the basic HTML for this:

<!DOCTYPE html>
<!-- Website - www.abhikesh.com -->
<html lang="en" dir="ltr">
  <head>
    <meta charset="UTF-8" />
    <title>Image Hover Animation HTML CSS | abhikesh</title>
    <link rel="stylesheet" href="style.css" />
  </head>
  <body>
    <div class="container">
      <div class="icon-image">
        <div class="icon">
          <img src="images/img1.jpg" alt="" />
        </div>
        <div class="hover-image one">
          <div class="img">
            <img src="images/img1.jpg" alt="" />
          </div>
          <div class="content">
            <div class="details">
              <div class="name">Rahul</div>
              <div class="job">Designer || Developer</div>
            </div>
          </div>
        </div>
      </div>
      <div class="icon-image">
        <div class="icon">
          <img src="images/img2.jpg" alt="" />
        </div>
        <div class="hover-image one">
          <div class="img">
            <img src="images/img2.jpg" alt="" />
          </div>
          <div class="content">
            <div class="details">
              <div class="name">Rohit</div>
              <div class="job">Blogger || Designer</div>
            </div>
          </div>
        </div>
      </div>
      <div class="icon-image">
        <div class="icon">
          <img src="images/img3.jpg" alt="" />
        </div>
        <div class="hover-image one">
          <div class="img">
            <img src="images/img3.jpg" alt="" />
          </div>
          <div class="content">
            <div class="details">
              <div class="name">Arzu</div>
              <div class="job">Designer || Developer</div>
            </div>
          </div>
        </div>
      </div>
      <div class="icon-image">
        <div class="icon">
          <img src="images/img4.jpg" alt="" />
        </div>
        <div class="hover-image one">
          <div class="img">
            <img src="images/img4.jpg" alt="" />
          </div>
          <div class="content">
            <div class="details">
              <div class="name">Shivani</div>
              <div class="job">Photographer || Youtuber</div>
            </div>
          </div>
        </div>
      </div>
      <div class="icon-image">
        <div class="icon">
          <img src="images/img5.jpg" alt="" />
        </div>
        <div class="hover-image one">
          <div class="img">
            <img src="images/img5.jpg" alt="" />
          </div>
          <div class="content">
            <div class="details">
              <div class="name">Aryn</div>
              <div class="job">Developer || Designer</div>
            </div>
          </div>
        </div>
      </div>
      <div class="icon-image last">
        <div class="icon">
          <img src="images/img6.jpg" alt="" />
        </div>
        <div class="hover-image one">
          <div class="img">
            <img src="images/img6.jpg" alt="" />
          </div>
          <div class="content">
            <div class="details">
              <div class="name">Anil</div>
              <div class="job">Blogger || Youtuber</div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>
  • Product Image: The image element that will display the product image.
  • Card Info: This section will include product details such as the name, price, and an “Add to Cart” button.

Style with CSS for the Transition

Next, add CSS to style the product card and create smooth transitions when users hover over it. We will use the z-index property along with other CSS properties like transform and transition to create this effect.

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap');
*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins',sans-serif;
}
body{
  height: 100vh;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #0396FF;
}
.container{
  height: 500px;
  display: flex;
  min-width: 400px;
  align-items: flex-end;
  justify-content: center;
  margin-top: -55px;
}
.icon-image{
  position: relative;
  height: 70px;
  width: 70px;
  margin: 0 5px;
  cursor: pointer;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.25);
  border-radius: 50%;
  background: #fff;
}
.icon-image .icon img{
  position: absolute;
  height: 95%;
  width: 95%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #0396FF;
}
.icon-image::before{
  content: '';
  position: absolute;
  width: 50px;
  height: 50px;
  left: 50%;
  top: -50px;
  transform: translateX(-50%);
}
.icon-image .hover-image{
  position: absolute;
  height: 350px;
  width: 300px;
  bottom: 100px;
  left: 50%;
  z-index: 0;
  transform: translateX(-50%);
  border-radius: 25px;
  pointer-events: none;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
  transition: transform 0.5s ease, z-index 0s, left 0.5s ease ;
  transition-delay: 0s, 0.5s, 0.5s;
}
.icon-image:hover .hover-image{
  left: -200px;
  z-index: 12;
  transform: translateX(80px);
  transition: left 0.5s ease, z-index 0s, transform 0.5s ease;
  transition-delay: 0s, 0.5s, 0.5s;
}
.hover-image img{
  position: absolute;
  height: 100%;
  width: 100%;
  object-fit: cover;
  border: 3px solid #fff;
  border-radius: 25px;
}
.hover-image .content{
  position: absolute;
  width: 100%;
  bottom: -10px;
  padding: 0 10px;
}
.content::before{
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  background: #fff;
  left: 50%;
  bottom: -7px;
  transform: rotate(45deg) translateX(-50%);
  z-index: -1;
}
.content .details{
  position: relative;
  background: #fff;
  padding: 10px;
  border-radius: 12px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}
.icon-image:hover .details{
  transition: all 0.5s ease;
  transition-delay: 0.9s;
  opacity: 1;
  transform: translateY(4px);
  pointer-events: auto;
}
.details::before{
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  background: #fff;
  left: 50%;
  bottom: -15px;
  transform: rotate(45deg) translateX(-50%);
  z-index: -1;
}
.content .details .name{
 font-size: 20px;
 font-weight: 500;
}
.content .details .job{
 font-size: 17px;
 color: #0396FF;
 margin: -3px 0 5px 0;
}
.content .details a:hover{
  color: #0396FF;
}
.container .last .hover-image{
  transition: none;
}
.container .last:hover .hover-image{
  transition: 0;
}
.last:hover .details{
  transition-delay: 0s;
}

This approach ensures the card adapts to mobile screens, maintaining a responsive and user-friendly design.

Best Practices for SEO and Performance

When building animated and interactive designs, it’s essential to consider SEO and performance optimization. Here are a few tips:

Semantic HTML: Use proper HTML tags like <h2>, <p>, and <button> to structure your content for search engines.

  • Optimize Images: Compress images to reduce load times while maintaining high quality.
  • Alt Text for Images: Use descriptive alt text to improve accessibility and SEO.
  • Responsive Design: Ensure your designs are mobile-friendly by testing them across different screen sizes.
  • Fast Load Times: Keep your CSS clean and lightweight to ensure faster loading times, which improves both user experience and SEO ranking.
Want to Check Username Availability on Social Media?If you’re looking to check username availability on various social media platforms, visit NameChkr to find out!
Read Also

  1. Glassmorphism Login Form in HTML and CSS
    Explore the stylish world of glassmorphism as you create a modern login form using HTML and CSS. This guide breaks down the design process step by step.
  2. Toggle Button using HTML, CSS, and JavaScript
    Discover how to enhance user interaction by creating a sleek toggle button with HTML, CSS, and JavaScript. This tutorial covers everything from structure to styling.
  3. Responsive Cards in HTML and CSS
    Learn how to design eye-catching responsive cards that adapt seamlessly to any device. This guide offers practical tips for achieving stunning layouts.
  4. Build a Google Gemini Chatbot Using HTML, CSS, and JS
    Dive into chatbot development by creating a Google Gemini chatbot with HTML, CSS, and JavaScript. This tutorial will help you understand the basics of interactive forms.

Conclusion

By following this guide, you’ve learned how to create stunning Z-Index transitions on images using only HTML and CSS. This powerful technique not only enhances your website’s visual appeal but also improves performance and SEO, all while maintaining a lightweight structure.
Ready to start building? You can download the complete source code below and try it out on your project.

Create a Beautiful Product Card with Smooth Animations

Today we are back again with another tutorial showing the process of creating an animated product card using just HTML and CSS. This is perfect for anyone looking to add interactive product cards to their website, providing users with a modern and engaging experience without needing JavaScript.

This tutorial is useful for both an experienced developer or even if you’re not a pro in web development. So, let’s create our animated product card that works across devices.

What is a Product Card?

A product card is a small visual element on a webpage that showcases essential product details. Typically, a product card includes:

  • High-Resolution Product Image
  • Product Name and Logo
  • Product Price
  • The “Add to Cart” Button
  • Color and Size Options

Adding an animated product card to your site can boost user interaction, helping visitors visualize product attributes like color, size, or variations. With CSS animations, you can create sleek transitions and effects that enhance the user experience.

Why Use Only HTML & CSS for Product Card Animation?

Using just HTML and CSS for your product card animations offers several advantages:

  1. No JavaScript Required: This keeps the website lightweight and ensures faster page load times.
  2. Responsive Design: CSS media queries allow you to make your product card design mobile-friendly and adaptable to any screen size.
  3. SEO-Friendly: By sticking to HTML and CSS, you optimize page performance, improving your site’s SEO ranking.
How to Create an Animated Product Card Using HTML & CSS

Follow the steps below to create a product card with smooth animations. We’ll focus on a simple and clean design while applying some beautiful CSS transitions to make the card visually appealing.

1. Set Up Your HTML Structure

The first step is to create the structure for the product card using semantic HTML. You’ll create an HTML file where you define the layout for your product card.

Here’s an example:

<!DOCTYPE html>
<!-- Designed by abhikesh | www.abhikesh.com/ -->
<html lang="en" dir="ltr">
<head>
  <meta charset="UTF-8">
  <title> Responsive Animated Product Card | abhikesh </title>
  <link rel="stylesheet" href="style.css">
  <!-- Boxicons CDN Link -->
  <link href='https://unpkg.com/[email protected]/css/boxicons.min.css' rel='stylesheet'>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
  <div class="product-card">
    <div class="logo-cart">
      <img src="images/logo.jpg" alt="logo">
      <i class='bx bx-shopping-bag'></i>
    </div>
    <div class="main-images">
      <img id="blue" class="blue active" src="images/blue.png" alt="blue">
      <img id="pink" class="pink" src="images/pink.png" alt="blue">
      <img id="yellow" class="yellow" src="images/yellow.png" alt="blue">
    </div>
    <div class="shoe-details">
      <span class="shoe_name">ADDIDAS GAZE ZX</span>
      <p>Lorem ipsum dolor sit lorenm i amet, consectetur adipisicing elit. Eum, ea, ducimus!</p>
      <div class="stars">
        <i class='bx bxs-star'></i>
        <i class='bx bxs-star'></i>
        <i class='bx bxs-star'></i>
        <i class='bx bxs-star'></i>
        <i class='bx bx-star'></i>
      </div>
    </div>
    <div class="color-price">
      <div class="color-option">
        <span class="color">Colour:</span>
        <div class="circles">
          <span class="circle blue active" id="blue"></span>
          <span class="circle pink " id="pink"></span>
          <span class="circle yellow " id="yellow"></span>
        </div>
      </div>
      <div class="price">
        <span class="price_num">$10.00</span>
        <span class="price_letter">Ten dollar only</span>
      </div>
    </div>
    <div class="button">
      <div class="button-layer"></div>
      <button>Add To Cart</button>
    </div>
  </div>
  <script>
    let circle = document.querySelector(".color-option");
    circle.addEventListener("click", (e) => {
      let target = e.target;
      if (target.classList.contains("circle")) {
        circle.querySelector(".active").classList.remove("active");
        target.classList.add("active");
        document.querySelector(".main-images .active").classList.remove("active");
        document.querySelector(`.main-images .${target.id}`).classList.add("active");
      }
    });
  </script>
</body>
</html>

In this example:

  • The product card container holds the product image and the product details.
  • Product image contains the image element for your product.
  • Product info includes the product name, price, and an “Add to Cart” button.

2. Style the Product Card with CSS

Now, we’ll use CSS to style the product card and add animations. You’ll need to create a separate CSS file or include the CSS within a <style> tag.

Here’s the basic CSS for styling and animations:

/* Google Fonts Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');
*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}
body{
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: linear-gradient(135deg, #43CBFF 10%, #9708CC 100%);
}
.product-card {
  position: relative;
  max-width: 355px;
  width: 100%;
  border-radius: 25px;
  padding: 20px 30px 30px 30px;
  background: #fff;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
  z-index: 3;
  overflow: hidden;
}
.product-card .logo-cart{
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.product-card .logo-cart img{
  height: 60px;
  width: 60px;
  object-fit: cover;
}
.product-card .logo-cart i{
  font-size: 27px;
  color: #707070;
  cursor: pointer;
  transition: color 0.3s ease;
}
.product-card .logo-cart i:hover{
  color: #333;
}
.product-card .main-images{
  position: relative;
  height: 210px;
}
.product-card .main-images img{
  position: absolute;
  height: 300px;
  width: 300px;
  object-fit: cover;
  transform: rotate(18deg);
  left: 12px;
  top: -40px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.product-card .main-images img.active{
  opacity: 1;
}
.product-card .shoe-details .shoe_name{
  font-size: 24px;
  font-weight: 500;
  color: #161616;
}
.product-card .shoe-details p{
  font-size: 12px;
  font-weight: 400;
  color: #333;
  text-align: justify;
}
.product-card .shoe-details .stars i{
  margin: 0 -1px;
  color: #333;
}
.product-card .color-price .color-option{
  display: flex;
  align-items: center;
}
.color-price{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}
.color-price .color-option .color{
  font-size: 18px;
  font-weight: 500;
  color: #333;
  margin-right: 8px;
}
.color-option  .circles{
  display: flex;
}
.color-option  .circles .circle{
  height: 18px;
  width: 18px;
  background: #0071C7;
  border-radius: 50%;
  margin: 0 4px;
  cursor: pointer;
  transition: all 0.4s ease;
}
.color-option  .circles .circle.blue.active{
  box-shadow: 0 0 0 2px #fff,
               0 0 0 4px #0071C7;
}
.color-option  .circles .circle.pink{
  background: #FA1795;
}
.color-option  .circles .circle.pink.active{
  box-shadow: 0 0 0 2px #fff,
               0 0 0 4px #FA1795;
}
.color-option  .circles .circle.yellow{
  background: #F5DA00;
}
.color-option  .circles .circle.yellow.active{
  box-shadow: 0 0 0 2px #fff,
               0 0 0 4px #F5DA00;
}
.color-price .price{
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.color-price .price .price_num{
  font-size: 25px;
  font-weight: 600;
  color: #707070;
}
.color-price .price .price_letter{
  font-size: 10px;
  font-weight: 600;
  margin-top: -4px;
  color: #707070;
}
.product-card .button{
  position: relative;
  height: 50px;
  width: 100%;
  border-radius: 25px;
  margin-top: 30px;
  overflow: hidden;
}
.product-card .button .button-layer{
  position: absolute;
  height: 100%;
  width: 300%;
  left: -100%;
  background-image: linear-gradient(135deg,#9708CC, #43CBFF,#9708CC, #43CBFF );
  transition: all 0.4s ease;
  border-radius: 25PX;
}
.product-card .button:hover .button-layer{
  left: 0;
}
.product-card .button button{
  position: relative;
  height: 100%;
  width: 100%;
  background: none;
  outline: none;
  border: none;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #fff;
}

In this CSS code:

  • The product card defines the overall card styling, including a border and a hover effect that scales the card when hovered.
  • Product image ensures the image is responsive, filling the card’s width.
  • Price styles the price in a standout color.
  • The button adds a hover effect to the “Add to Cart” button.

3. Make Your Product Card Responsive

To ensure the product card works well across different devices, you’ll want to include media queries. Here’s a simple way to adjust the product card for smaller screens:

@media screen and (max-width: 600px) {
  .product-card .button button{
    color: pink;
  }
}

This media query adjusts the card width on screens smaller than 600px, ensuring it remains user-friendly on mobile devices.

Best Practices for SEO and Performance

When building a website, especially one that features animations and interactivity, it’s crucial to optimize for SEO and page performance. Here are a few crucial tips to remember:

  • Use Semantic HTML: Properly structure your HTML using appropriate tags like <h2>, <p>, and <button>. This helps search engines understand your content.
  • Optimize Images: Use high-quality images, but make sure they’re compressed to improve page loading speed.
  • Alt Text for Images: Ensure each image includes descriptive alt text to improve accessibility and SEO.
  • Responsive Design: Make sure your product cards look great on all devices by using media queries.
  • Fast Load Times: Clean and simple CSS ensures faster loading times, which is beneficial for SEO.
Want to Check Username Availability on Social Media?If you’re looking to check username availability on various social media platforms, visit NameChkr to find out!
Read Also

  1. Glassmorphism Login Form in HTML and CSS
    Explore the stylish world of glassmorphism as you create a modern login form using HTML and CSS. This guide breaks down the design process step by step.
  2. Toggle Button using HTML, CSS, and JavaScript
    Discover how to enhance user interaction by creating a sleek toggle button with HTML, CSS, and JavaScript. This tutorial covers everything from structure to styling.
  3. Responsive Cards in HTML and CSS
    Learn how to design eye-catching responsive cards that adapt seamlessly to any device. This guide offers practical tips for achieving stunning layouts.
  4. Build a Google Gemini Chatbot Using HTML, CSS, and JS
    Dive into chatbot development by creating a Google Gemini chatbot with HTML, CSS, and JavaScript. This tutorial will help you understand the basics of interactive forms.

Conclusion

By following this guide, you’ve learned how to create a fully responsive, animated product card using only HTML and CSS. The simple but elegant design showcases how CSS transitions can bring life to a product display, without the need for JavaScript.

If you’re ready to start building your animated product card, you can download the source code below.