w3tweaks
  • Effects
    • Scroll Effects
    • Text Effects
    • Shadow
  • Essentials
    • Arrows
    • Buttons
    • Background Patterns
    • Border Examples
    • Cards
    • Color Palettes
    • Dividers
    • Link styles
    • Loaders
    • Modal Windows
    • Notifications
    • Progress bar
    • Quote styles
    • Spinner
    • Tooltips
  • Media
    • Calendars
    • Carousels
    • Clocks
    • Gallery
    • Music Players
    • Sliders
    • Slideshows
    • Tables
    • Thumbnails
  • Navigation
  • Inputs
    • Range Sliders
    • Checkboxes
    • Toggle Switches
  • Scripts
    • Angularjs
    • Backbone.js
    • bootstrap
    • jQuery
    • ReactJs
    • JavaScript
    • Syntax Highlighters
    • tryit editor
    • PHP
  • API’s
    • Facebook
    • Google
    • Indeed
    • Twitter
    • YouTube
w3tweaks
  • Effects
    • Scroll Effects
    • Text Effects
    • Shadow
  • Essentials
    • Arrows
    • Buttons
    • Background Patterns
    • Border Examples
    • Cards
    • Color Palettes
    • Dividers
    • Link styles
    • Loaders
    • Modal Windows
    • Notifications
    • Progress bar
    • Quote styles
    • Spinner
    • Tooltips
  • Media
    • Calendars
    • Carousels
    • Clocks
    • Gallery
    • Music Players
    • Sliders
    • Slideshows
    • Tables
    • Thumbnails
  • Navigation
  • Inputs
    • Range Sliders
    • Checkboxes
    • Toggle Switches
  • Scripts
    • Angularjs
    • Backbone.js
    • bootstrap
    • jQuery
    • ReactJs
    • JavaScript
    • Syntax Highlighters
    • tryit editor
    • PHP
  • API’s
    • Facebook
    • Google
    • Indeed
    • Twitter
    • YouTube
w3tweaks
Home CSS Code Demos
CSS Button Concept for Remove and Success

CSS Button Concept for Remove and Success

W3TWEAKS by W3TWEAKS
August 21, 2019
in CSS Code Demos
0

A cool little css Button concept for delete success with hover animation with close/delete icon and developed using CSS, HTML and JavaScript. Demo and download available.

You might also like

CSS Shapes Forest Collection Spring Summer 2020

CSS Shapes Forest Collection Spring Summer 2020

October 11, 2020
0
Three Pure different CSS Button effects

Three Pure different CSS Button effects

September 25, 2019
0

Demo Download

Author Chris Deacy
Created MARCH 20, 2015
License Open
Compatible browsers Chrome, Firefox, Safari
[ads1]

 

HTML Snippet

<a class="button" href="#" role="button"> <span>remove</span>
    <div class="icon"> <i class="fa fa-remove"></i> <i class="fa fa-check"></i> </div>
</a>

CSS Code



.button {
    display: block;
    background-color: #c0392b;
    width: 300px;
    height: 100px;
    line-height: 100px;
    margin: auto;
    color: #fff;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    cursor: pointer;
    overflow: hidden;
    border-radius: 5px;
    box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.3);
    transition: all 0.25s cubic-bezier(0.31, -0.105, 0.43, 1.4);
}

.button span,
.button .icon {
    display: block;
    height: 100%;
    text-align: center;
    position: absolute;
    top: 0;
}

.button span {
    width: 72%;
    line-height: inherit;
    font-size: 22px;
    text-transform: uppercase;
    left: 0;
    transition: all 0.25s cubic-bezier(0.31, -0.105, 0.43, 1.4);
}

.button span:after {
    content: '';
    background-color: #a53125;
    width: 2px;
    height: 70%;
    position: absolute;
    top: 15%;
    right: -1px;
}

.button .icon {
    width: 28%;
    right: 0;
    transition: all 0.25s cubic-bezier(0.31, -0.105, 0.43, 1.4);
}

.button .icon .fa {
    font-size: 30px;
    vertical-align: middle;
    transition: all 0.25s cubic-bezier(0.31, -0.105, 0.43, 1.4), height 0.25s ease;
}

.button .icon .fa-remove {
    height: 36px;
}

.button .icon .fa-check {
    display: none;
}

.button.success span,
.button:hover span {
    left: -72%;
    opacity: 0;
}

.button.success .icon,
.button:hover .icon {
    width: 100%;
}

.button.success .icon .fa,
.button:hover .icon .fa {
    font-size: 45px;
}

.button.success {
    background-color: #27ae60;
}

.button.success .icon .fa-remove {
    display: none;
}

.button.success .icon .fa-check {
    display: inline-block;
}

.button:hover {
    opacity: .9;
}

.button:hover .icon .fa-remove {
    height: 46px;
}

.button:active {
    opacity: 1;
}

JavaScript Snippet

Below js code will add and remove ‘success’ class from the button when button clicked to animate the button.

(function() {
    var removeSuccess;
    removeSuccess = function() {
        return $('.button').removeClass('success');
    };
    $(document).ready(function() {
        return $('.button').click(function() {
            $(this).addClass('success');
            return setTimeout(removeSuccess, 3000);
        });
    });
}).call(this);

Preview

CSS Button Concept for Remove and Success preview

Tags: animationButtonclick buttonsConceptCSScss buttonsdeleteeffectessentialshoverhover animationhtmlremoveSuccess
Previous Post

Three Pure different CSS Button effects

Next Post

Sketched up Pure CSS Next button with animated SVG arrow icon

W3TWEAKS

W3TWEAKS

Since I've had a strong background in front-end development, I took the initiative to start my own website (w3tweaks.com) to share my knowledge with the world.

Related Stories

CSS Shapes Forest Collection Spring Summer 2020

CSS Shapes Forest Collection Spring Summer 2020

by W3TWEAKS
October 11, 2020
0
0

Paulina Hetman crafts a forest full of one-div CSS shapes. Click the button to assemble them into a scene! See...

Three Pure different CSS Button effects

Three Pure different CSS Button effects

by W3TWEAKS
September 25, 2019
0
0

Three Pure CSS Button effects like tap, hover and click effects developed using CSS and HTML. Demo and Download available....

Easy customizable simple CSS buttons

Easy customizable simple CSS buttons

by W3TWEAKS
September 8, 2019
0
0

A series of simple CSS buttons. They are easy to customize and use. Can easily be integrated with Font-Awesome or...

Rounded CSS buttons with mouseover effect

Rounded CSS buttons with mouseover effect

by W3TWEAKS
September 8, 2019
0
0

Rounded CSS buttons with mouseover effect and click effect. Buttons are developed using css and html. Demo and download available....

Next Post

Sketched up Pure CSS Next button with animated SVG arrow icon

Discussion about this post

We bring you the best frontend collections that will fix perfect for news, magazine, personal blog, etc. Check our landing page for details.

  • Effects
    • Scroll Effects
    • Text Effects
    • Shadow
  • Essentials
    • Arrows
    • Buttons
    • Background Patterns
    • Border Examples
    • Cards
    • Color Palettes
    • Dividers
    • Link styles
    • Loaders
    • Modal Windows
    • Notifications
    • Progress bar
    • Quote styles
    • Spinner
    • Tooltips
  • Media
    • Calendars
    • Carousels
    • Clocks
    • Gallery
    • Music Players
    • Sliders
    • Slideshows
    • Tables
    • Thumbnails
  • Navigation
  • Inputs
    • Range Sliders
    • Checkboxes
    • Toggle Switches
  • Scripts
    • Angularjs
    • Backbone.js
    • bootstrap
    • jQuery
    • ReactJs
    • JavaScript
    • Syntax Highlighters
    • tryit editor
    • PHP
  • API’s
    • Facebook
    • Google
    • Indeed
    • Twitter
    • YouTube