css menu hover underline

How we can create an underline effect on hover for menu items? Solution: See this CSS Menu Hover Underline Effect, Simple a Line in Bottom Of Text.

Previously I have shared a link hover effect, it also like that but it is a little different and the effect on menu items. Basically, these types of text underline effects are used by many websites. When a user hovers on any link then the underline appears with an animation effect, that attracts users. And somebody use is on the normal link, some use in important navigation links, some on both.

Today you will learn to create a line at the bottom of the text on mouseover. Basically there are 5 list items when you will over on any one of these, then an underline will appear on the bottom side of the text. The main fact of this underline is it starts from left and end on right, that effect looks like a kind of circular movement. Also, this animation makes it different from previously shared programs.

So, Today I am sharing CSS Menu Hover Underline Effect. There I have used pure CSS to create this effect, there is no JavaScript of any other library. And this is a basic thing you can create using only HTML and CSS. It can be good practice for a beginner, also you can use this effect on your websites links or important text.

If you are thinking now how this text bottom sideline effect actually is, then see the preview given below.

Preview Of Line in Bottom Of Text

See this video preview to getting an idea of how this text underline effect looks like.

Live Demo

Now you can see this visually, also you can see it live by pressing the button given above. If you like this, then get the source code of its.

You May Also Like:

CSS Menu Hover Underline Effect Source Code

Before sharing source code, let’s talk about it. First I have created menu items using HTML list tags <ul> & <li> . Inside the list items, I have placed hyperlink tags with text. Hyperlinks are blank, you can fill up these with your links. HTML has very fewer codes, also I have linked the CSS file in the HTML file.

Now using CSS I have placed all the list items in the right place, as you can see in the preview. The link hovers effect is not based on border-bottom or underline commands, it based on blank content with 3px height. For creating this, I have used CSS blank content with :after command (info). And placed the line under the text by giving the value of top: 100%; .

Also I have done some other basic things using CSS. Left all other things you will understand after getting the codes, I can’t explain all in writing. For creating this program you have to create 3 files. First for HTML, second for CSS, and the third for JavaScript. Follow the steps to creating this without any error.

index.html

Create an HTML file named ‘index.html‘ and put these codes given below.

style.css

Now create a CSS file named ‘style.css‘ and put these codes given here.

That’s It. Now you have successfully created CSS Menu Hover Underline Effect, Line in Bottom Of the Text. If you have any doubt or question comment down below.

Thanks For Visiting, Keep Visiting.

2 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here