Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • jQuery
  • AngularJS
  • ReactJS
  • Next.js
  • React Native
  • NodeJS
  • Express.js
  • MongoDB
  • MERN Stack
  • PHP
  • WordPress
  • Bootstrap
  • Tailwind
  • CSS Frameworks
  • JS Frameworks
  • Web Development
Open In App
Next Article:
How to Create Text Reveal Effect for Buttons using HTML and CSS ?
Next article icon

How to create paper corner fold effect on hover by using HTML and CSS?

Last Updated : 25 Apr, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

The folding effect is quite attractive on the website, may you have seen on some websites when you hover on the paging layout it gets folded on the corner. The folding corner effect can be achieved by using HTML and CSS only. The below sections will guide you on how to create the animation. In this article, we will divide the article into two sections in the first section we will create the basic structure. In the second section, we will decorate the structure. 
Creating Structure: In this section, we will use only HTML to create the structure where we will use the corner folding effect. 
 

  • HTML Code: In this section we will create a basic div using the div tag giving it a class name.
  •  
     

HTML

<!DOCTYPE html>
<html lang="en" dir="ltr">
 
<head>
    <meta charset="utf-8">
    <title>
        Paper corner fold effect on hover
        by using HTML and CSS
    </title>
</head>
 
<body>
    <center>
        <h1>
            GeeksforGeeks
        </h1>
        <b>
            Paper corner fold effect on hover
            by using HTML and CSS
        </b>
        <div class="Fold">
            <h3>
            A Computer Science Portal for Geeks</h3>
        </div>
    </center>
</body>
 
</html>                   
                      
                       


Design Structure: In this section, we will use only CSS to decorate the structure which is already created in the above section.
 

  • CSS Code: In this section, we will first style the basic div element without the fold effect, then to create the fold effect we will use the CSS ::after pseudo-element. that will be positioned on the top right corner of the div box, the top and right border are set to colours that match the background color of parent div element.The left and bottom border are then given a darker shade of the div background color, we will also use the hover selector to create the folding effect when we hover the mouse over the box. 
     

CSS

<style>
        h1 {
            color: green;
        }
         
        .Fold {
            position: absolute;
            left: 50%;
            top: 55%;
            transform: translate(-50%, -50%);
            width: 400px;
            height: 200px;
            background-color: #4EE73C;
        }
         
        h3 {
            margin: 20px;
            padding: 20px;
        }
         
        .Fold:after {
            position: absolute;
            content: '';
            right: 0;
            top: 0;
        }
         
        .Fold:hover:after {
            transition-duration: 1s;
            border-bottom: 50px solid black;
            border-right: 50px solid white;
        }
</style>
                      
                       


Final Solution: It is the combination of the above two coding sections, y combining the above section we have created a folded corner effect on hover. 
 

HTML

<!DOCTYPE html>
<html lang="en" dir="ltr">
 
<head>
    <meta charset="utf-8">
    <title>
        Paper corner fold effect on hover
        by using HTML and CSS
    </title>
    <style>
        h1 {
            color: green;
        }
         
        .Fold {
            position: absolute;
            left: 50%;
            top: 55%;
            transform: translate(-50%, -50%);
            width: 400px;
            height: 200px;
            background-color: #4EE73C;
        }
         
        h3 {
            margin: 20px;
            padding: 20px;
        }
         
        .Fold:after {
            position: absolute;
            content: '';
            right: 0;
            top: 0;
        }
         
        .Fold:hover:after {
            transition-duration: 1s;
            border-bottom: 50px solid black;
            border-right: 50px solid white;
        }
    </style>
</head>
 
<body>
    <center>
        <h1>
            GeeksforGeeks
        </h1>
        <b>
            Paper corner fold effect on hover
            by using HTML and CSS
        </b>
        <div class="Fold">
            <h3>
            A Computer Science Portal for Geeks</h3>
        </div>
    </center>
</body>
 
</html>
                      
                       

Output: 
 


 



Next Article
How to Create Text Reveal Effect for Buttons using HTML and CSS ?

L

lakshgoel204
Improve
Article Tags :
  • Web Technologies
  • Web Templates

Similar Reads

  • How to create Image Folding Effect using HTML and CSS?
    In this article, we are going to create an image folding effect below the main image. This is a simple project, we can achieve our target only by using HTML and CSS. Approach: Create the main div in which we are creating 4 list tags.Use of nth-child() selector property to give different styles to di
    2 min read
  • How to create Skewed Background with hover effect using HTML and CSS?
    The skewed background or you can say an angel color shade background can be created by using HTML and CSS. This background can be used as a cover pic of your website that will be attractive. In this article, we will create a simple skewed background. We will divide the article into two sections in t
    2 min read
  • How to Create Text Reveal Effect for Buttons using HTML and CSS ?
    Buttons are the most important user interface component for any website. It is very important to design the buttons in a creatively unique way. The text-reveal effect for a button is used when it is used to reveal some offer or exciting content for enhancing the user experience. Approach: The approa
    2 min read
  • How to Create Floating Box Effect using HTML and CSS ?
    The floating box effect is a classical example of a custom box-shadow technique. In this technique, we create realistic-looking shadows without using the box-shadow property that is provided by the CSS. Approach: The approach is to use after selector to use create shadow using the blur function. HTM
    2 min read
  • How to create followspot effect using HTML CSS and jQuery ?
    The follow-spot effect (spotlight effect) is an effect that can be easily implemented using jQuery. The effect is quite popular for the opening or front banner design for any website. Approach: The approach is to use circle CSS on the mouse movement effect using the mousemove() function provided by
    2 min read
  • How to create Glowing Star effect using HTML and CSS?
    The glowing star effect is one of the coolest effects that is used for dark themed websites. It is known as star effect because it has small glowing balls animated in different ways which looks like stars. This effect can be used for image slider, loader, and maybe as an showcase UI element. Approac
    3 min read
  • How to Create Animated Navigation Bar with Hover Effect using HTML and CSS ?
    The Navigation bar or navbar or menu-bar is the most important component of any web or mobile application. The user can only navigate from one page to another page through this menu. It is usually provided at the top of the website to provide a better UX (user experience). Approach: The approach is
    3 min read
  • How to Create Ghost Text Animation on Hover using HTML and CSS?
    Ghost Text Animation can be used to give your website a spooky heading or sub-heading, this effect can be easily created using some simple HTML and CSS. HTML Code: In this section we have a ul tag which consists of some li tags displaying some text. [GFGTABS] html <!DOCTYPE html> <html lang
    2 min read
  • How to create an Image Overlay Zoom Effect on hover using CSS ?
    Image Overlay Zoom Effect on hover can be done by using CSS. This effect is used in web design for user attention to images by highlighting the content or text, and to improve the overall look of a website by adding dynamic visual effects. We have given a Zoom effect to the text and image when the u
    2 min read
  • How to Create an Image Overlay Fade in Text Effect on Hover using CSS ?
    In the context of web design, it's all about making dynamic and interesting user experiences(UI). Adding picture overlay effects to the website is a good method to improve the aesthetic appeal, especially when users interact with it by hovering over images. This article will walk you through the ste
    3 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences