Animated Button
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="STYLESHEET" type="text/css" href="web.css">
<title>web design</title>
</head>
<body>
<h2>Animated Button</h2>
<button class="button" style="vertical-align: middle;"><span>Hover</span></button>
</body>
</html>
CSS Animated Button Style
.button{
display: inline-block;
border-radius: 4px;
background-color: #f4511e;
border: none;
color: #fff;
text-align: center;
font-size:28px;
padding:20px;
width:200px;
transition: all 0.5s;
cursor: pointer;
margin:5px;
}
span{
cursor: pointer;
display: inline-block;
position: relative;
transition:0.5s;
}
span::after{
content: '\00bb';
position: absolute;
opacity:0 ;
top: 0;
right:-20px;
transition:0.5s;
}
.button:hover span{
padding-right:-25px;
}
.button:hover span::after{
opacity: 1;
right:0 ;
}
No comments:
Post a Comment