Search
 
SCRIPT & CODE EXAMPLE
 

CSS

button animation css codepen

<div class="main-container">
    <button class="button">Hover over</button>
</div>
<style>
* {
  margin: 0;
  padding: 0;
  box-sizing: content-box;
}

html,
body {  
    width: 100%;
    height: 100%;
} 

.main-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #111111;
    color: #ffffff;
}

.button {
  position: relative;
  background-color: transparent;
  padding: 10px 20px;
  color: #ffffff;
  border: none;
  font-size: 1.9em;
  transform: none;
  cursor: pointer;
}

.button:after {
  content: "";
  height: 100%;
  width: calc(100% + 20px);
  position: absolute;
  top: -2px;
  left: -10px;
  border-top: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transition: 1s;
}

.button:before {
  content:"";
  height: calc(100% + 20px);
  width: 100%;
  position: absolute; 
  top: -10px;
  left: -2px;
  border-left: 2px solid #fff;
  border-right: 2px solid #fff;
  transition: 1s;
}

.button:hover:before {
  transform: rotateY(180deg);
}

.button:hover:after {
  transform: rotateX(180deg);
}
</style>
Comment

button hover animation css codepen

.docBtn:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, #00c897 50%, transparent 50%);
  z-index: -1;
  overflow: hidden;
  color: black;
}

.docBtn,
.docBtn:after {
  background-size: 300%;
  background-position: 100%;
  transition: 1s, font-size 0.2s;
}

.docBtn:hover,
.docBtn:hover:after {
  background-position: 0;
  font-size: 1.1em;
  border-radius: 100px;
  color: white;
}
Comment

PREVIOUS NEXT
Code Example
Css :: bulma lowercase 
Css :: how to apply a transition to a child element when hovering over parent element 
Css :: css grid tutorial 
Css :: target element pseudo-classes 
Css :: mini.css 
Css :: css gradient 
Css :: login and register files have no css laravel vue 
Css :: how to give css only to a paticular image 
Css :: how long ago was 1993 years 
Css :: css style link 
Css :: css rich text editor tailwind 
Css :: css tutorial point 
Css :: Hoow to open a css class in css 
Css :: apply style to only children not grandchildren 
Css :: on hover active until i hover next css 
Css :: button not aligning right css 
Css :: .quform-sub-label 
Css :: div after rotation some part not showing 
Css :: installer scss projet wordpress 
Css :: button background position left to right hover css 
Css :: showing danger message in red in terminal bash 
Css :: andy css reset 
Css :: jitsi meet index.html add css version 
Css :: frontend to backend fetching 
Css :: button slant right with icon 
Css :: scss multiple classes same style 
Css :: look and feel 
Css :: make td match display flex 
Css :: prevent child margin from moving parent css 
Css :: wordpress localhost css not working 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =