Animated underline

Size
2,593 Kb
Views
10,120

How do I make an animated underline?

What is a animated underline? How do you make a animated underline? This script and codes were developed by Kasper Mikiewicz on 21 November 2022, Monday.

Animated underline Previews

Animated underline - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Animated underline</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ body { padding: 5%;
}
.nav { list-style: none; padding: 0;
}
.nav > li { display: inline-block;
}
.nav > li ~ li { margin-left: 1em;
}
.nav a { color: #666; text-decoration: none; direction: ltr;
}
.nav a:focus, .nav a:hover { color: #CF000F;
}
.nav a:focus:after, .nav a:hover:after { opacity: 1; width: 100%;
}
.nav a:after { margin: 0 auto; content: ''; display: block; border-top: 1px solid; border-top-color: inherit; width: 0%; opacity: 0; transition: .25s;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <h1>Animated underline</h1>
<ul class="nav"> <li><a href="#">Nav item 1</a></li> <li><a href="#">Nav item 2</a></li> <li><a href="#">Nav item 3</a></li> <li><a href="#">Nav item 4</a></li>
</ul>
<p><small><b>Info:</b> By default line is aligned to center using <code>margin: 0 auto</code>, for left/right aligmnent, remove that <code>margin: 0 auto</code> and use <code>direction: [ltr | rtl]</code>. Line color is inherited from link color.</small></p> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
</body>
</html>

Animated underline - Script Codes CSS Codes

body { padding: 5%;
}
.nav { list-style: none; padding: 0;
}
.nav > li { display: inline-block;
}
.nav > li ~ li { margin-left: 1em;
}
.nav a { color: #666; text-decoration: none; direction: ltr;
}
.nav a:focus, .nav a:hover { color: #CF000F;
}
.nav a:focus:after, .nav a:hover:after { opacity: 1; width: 100%;
}
.nav a:after { margin: 0 auto; content: ''; display: block; border-top: 1px solid; border-top-color: inherit; width: 0%; opacity: 0; transition: .25s;
}
Animated underline - Script Codes
Animated underline - Script Codes
Home Page Home
Developer Kasper Mikiewicz
Username Idered
Uploaded November 21, 2022
Rating 3
Size 2,593 Kb
Views 10,120
Do you need developer help for Animated underline?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Kasper Mikiewicz (Idered) Script Codes
Create amazing art & images with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!