16+ CSS Open Close Buttons
An open-close button in CSS generally refers to a button used in web interfaces to toggle the visibility of a menu, panel, dialog, or other content. These buttons are commonly seen in responsive designs, especially for navigation menus in mobile views (often represented as a “hamburger” icon which transforms into a “‘X‘” icon).
In this post, I have shared a collection of 16+ CSS open close buttons, complete with their source code. This compilation showcases a variety of close animations and effects, offering diverse styles from simple toggles to intricate animations. Each button is uniquely designed to enhance user interaction, providing both functionality and aesthetic appeal to your web projects.
Also Read:
How to Create a CSS Pulse Animation Button
Multi Column Slider | Multiple Item Carousel Html CSS
Open & Close Button CSS

Author
Travis Hedrick
Source Code
Language
HTML & CSS
Responsive
Yes
Description
This Open Close Button example showcases a button with an interactive hover effect. Styled primarily with CSS, the button changes color, border, and undergoes a transformation upon hovering. The key CSS properties include transition: all 0.3s ease-out, which smooths the transition effects, and transform: scale(0.8) rotateZ(90deg) on hover, scaling down the button and rotating it.
Cross Close Button

Author
Paraskevas Dinakis
Source Code
Language
HTML & CSS
Responsive
Yes
Description
This Cross Close Button example features a button designed to look like a cross, typically used for closing interfaces. The button is created using CSS, specifically through the .inner:before and .inner:after pseudo-elements. These elements are styled with a height, width, and background color, and positioned absolutely within a parent div. They are initially rotated at 45 and -45 degrees to form a cross. On hover, the :hover pseudo-class alters their rotation to 0 degrees and moves them vertically, creating a dynamic effect.
Menu Close Button Animation

Author
Pentagear
Source Code
Language
HTML & CSS
Responsive
Yes
Description
This example is to create a button with an interactive animation effect, showcasing how CSS and JavaScript can work together for dynamic UI elements.
- CSS for Button Spans: The spans inside the button are styled with properties like
width,height, andbackground-color. They are positioned usingposition: absoluteand rotated usingtransform: rotate(45deg)or similar values to create a cross shape. - JavaScript Click Event: A jQuery click event handler is attached to the button. This handler toggles a class on the button, which likely triggers the CSS transformations.
- CSS Transformations on Toggle: The toggled class modifies the CSS
transformproperty of the spans, changing their rotation and position, thus altering the button’s appearance dynamically on click.
Open & Close Button With Animation

Author
Murphy Randle
Source Code
Language
HAML, SCSS & Js
Responsive
Yes
Close Animation

Author
Maneesh
Source Code
Language
HAML, SCSS & Js
Responsive
Yes
Smooth Hamburger Close Button

Author
Trevor Phillippi
Source Code
Language
Pug, SCSS & Js
Responsive
Yes
Close Button

Author
Jermbo
Source Code
Language
Html & Less
Responsive
Yes
CSS Animated Open and Close Button

Author
Jerome Renders
Source Code
Language
Pug, SASS & Js
Responsive
Yes
Html Close Button

Author
merrybottle
Source Code
Language
Html & CSS
Responsive
Yes
Simple Pure CSS Close Button

Author
Marvin van Kalsbeek
Source Code
Language
Html & CSS
Responsive
Yes
Hamburger Menu Button to Close Button

Author
Markmiscavage
Source Code
Language
Html, CSS & Js
Responsive
Yes
Hamburger to Close Button

Author
Gaurav Patil
Source Code
Language
Html, CSS & Js
Responsive
Yes
Open and Close Button With Animation

Author
Martin Wolf
Source Code
Language
Html, CSS & Js
Responsive
Yes
Interactive Animated Close Button

Author
Marius Nicula
Source Code
Language
Html & CSS
Responsive
Yes
Close Button CSS Animation

Author
Bert-Ulrich Baumann
Source Code
Language
Html, CSS & Js
Responsive
Yes
Different Close Button Effects

Author
Jonas Badalic
Source Code
Language
Html, CSS & Js
Responsive
Yes
Different Flipping Style Close Buttons

Author
Mikael Ainalem
Source Code
Language
Html & CSS
Responsive
Yes
Animated Close Button CSS

Author
Ellorex
Source Code
Language
Html & CSS
Responsive
Yes