Combine JS & CSS :
button{
/* 1st state */
}
button:hover{
/* hover state */
}
button:active{
/* click state */
}
button.active{
/* after click state */
}
jQuery('button').click(function(){
jQuery(this).toggleClass('active');
});
More Related Contents:
- Remove blue underline from link
- How to make button look like a link?
- Difference between @import and link in CSS
- Need to remove href values when printing in Chrome
- CSS – style a link based on its “rel” attribute?
- Align inline-block DIVs to top of container element
- What does a space mean in a CSS selector? i.e. What is the difference between .classA.classB and .classA .classB?
- CSS selector for first element with class
- Text in a flex container doesn’t wrap in IE11
- Customizing Bootstrap CSS template
- What is WebKit and how is it related to CSS?
- How to add a color overlay to a background image? [duplicate]
- Center a ‘div’ vertically in a % height ‘div’
- Managing CSS Explosion
- Common CSS Media Queries Break Points [duplicate]
- How to validate vendor prefixes in CSS like -webkit- and -moz-?
- How to display a reverse-ordered list in HTML?
- Can you use if/else conditions in CSS?
- How can I remove space (margin) above HTML header?
- DIV’s vs. Tables or CSS vs. Being Stupid
- Two-tone background split by diagonal line using css
- How do I stop Chrome from yellowing my site’s input boxes?
- Can type selectors be repeated to increase specificity?
- Should border-radius clip the content?
- how to override font boosting in mobile chrome
- How do I apply vendor prefixes to inline styles in reactjs?
- Where do CSS and JavaScript files go in a Maven web app project?
- Tint image using CSS without overlay
- Difference between and with text-align:center;?
- how to handle ‘double opacity’ of two overlapping divs