Underline Animation Effect on hover the text using simple css | Sanwebcorner

Underline Animation Effect on hover the text using simple css

Using css we can animated several things, This is one of the different and interesting thinking to animated text underline bar with gradient with animation effect. Now will see how to create underline animation effect on hover the underline text using css.

In this underline animation the underline bar background gradient moves the left to right with different gradient background colors. You can change the gradient background colors by changing the background color codes in the below example code

background: linear-gradient(to bottom, rgba(20, 20, 20, 0.8), rgba(20, 20, 20, 0.8)) center 1.08em/100% 

This types of effects is really different thinking. Here is the full code for how to do the underline animation effect on hover the text using the simple css, You can download the full code here to use this underline animation. And also having the demo links to display the result of this example. I hope this example really helpful.

Html code for Underline Animation Effect on hover the text :

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Underline Animation Effect on hover the text using simple css</title>
<link rel="stylesheet" href="css/style.css">  
</head>
<body>
<div class="page-example">
<a href="http://www.sanwebcorner.com" target="_blank">Underline Gradient Animation Effect<br/></a>
</div>
<br/> <br/>
<div class="page-example">
<a href="http://www.sanwebcorner.com" target="_blank">Underline Gradient Animation Effect on hover<br/></a>
<br/><br/>
</div>

<div class="page-example">
<h2><a href="http://www.sanwebcorner.com">www.sanwebcorner.com</a></h2>
<br/><br/>
</div>
</body>
</html>

Css Code for Underline Animation Effect on hover the text :

html{

line-height: 1.15;
}

a {
color: transparent;
display: inline-block;
overflow: hidden;
position: relative;
text-decoration: none;
text-shadow: 0 0 #141414, 0.08em 0 0 #fff, 0 0, -0.08em 0 0 #fff;
vertical-align: bottom;
}
a:after {
background: linear-gradient(to bottom, rgba(20, 20, 20, 0.8), rgba(20, 20, 20, 0.8)) center 1.08em/100% 5px no-repeat;
content: "";
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 400%;
will-change: transform;
z-index: -1;
}
a:hover:after {
-webkit-animation: underline-gradient 6s linear infinite;
animation: underline-gradient 6s linear infinite;
background-image: linear-gradient(90deg, rgba(122, 95, 255, 0.8) 15%, rgba(1, 255, 137, 0.6) 35%, rgba(122, 95, 255, 0.8) 85%);
}

@-webkit-keyframes underline-gradient {
0% {
-webkit-transform: translate3d(0%, 0%, 0);
transform: translate3d(0%, 0%, 0);
}
100% {
-webkit-transform: translate3d(-75%, 0%, 0);
transform: translate3d(-75%, 0%, 0);
}
}

@keyframes underline-gradient {
0% {
-webkit-transform: translate3d(0%, 0%, 0);
transform: translate3d(0%, 0%, 0);
}
100% {
-webkit-transform: translate3d(-75%, 0%, 0);
transform: translate3d(-75%, 0%, 0);
}
}
/* page layout */
html,
body {
height: 90%;
}


.page-example {
font-size: 3vw;
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
text-align: center;
}

Post a Comment

Labels

360 degree view product image 3d rotate 3d text 3step-form Accordion menu ajax All Browsers Animated Background Gradient animation audio controller auto complete Best accordion menu bootstrap border bounce effect on hover Breadcrumb calculate age by dob calendar Captcha change image on mouse move color chooser countdown Counter on scroll create random number Css css animation css buttons css hover css3 customized upload Button Date picker delete data from table Different scroll speed email otp verification email verifier Embed eventlist Expanding Menu feedbck form flash news section close button full screen menu Google custom search Google Maps Google reCAPTCHA Google site search gradient hide menu Horizontal News ticker Hover Htm Html html dropdown html form html5 html5 form validation Iframe image hover increment decrement textbox value based on select box Javascript Jquery js Layered image effect on mouse hover lock & unlock page scroll marquee marquee with close button mobile number validation mobile otp login Multi-level-drop-down-menu multi-level-form Multi-Step-form mysql News ticker on hover change text to image our team page password generator password strength checker Photoshop PHP populate html selectbox Popup image on click the link pure css Question type form random number generate Random password Redirect page Based on the select box while submit the form responsive responsive menu responsive popup box Responsive Vertical Time line design rotate image selectbox based on select box simple coming soon page simple countdown based on end date simple typing effect slider sliding tab sms otp login statistic counter on scroll switch tag shape team member Time picker toggle toggle view transparent button underline animation up down slide validation vertical fixed sidebar Webtips Youtube