css expand button on hover

How we can create an expanding button on hover using HTML and CSS? Solution: See this CSS Expand Button On Hover Effect, Expanding Button With Icon.

Previously I have shared many buttons related programs and button hover effects, but this is about expanding button. These types of expanding buttons use many websites, in modern-days all webpage elements become fancy or good looking. You will see a simple text for navigation, but when you will hover on it then that will become a button.

Today you will learn to create Expanding Button With Icon. Basically, there is a button with an icon and a text and when you will hover on anything like a button or text then these two will merge and you will see a big single button. The small button covers the text on hover and pretends like a whole large button.

So, Today I am sharing CSS Expand Button On Hover Effect. There I have used pure CSS for creating the button effect, and layout is based on simple HTML. There are no JS or any other library, also the best fact of this program is icon also based on CSS. This program will be good practice for you of pure HTML & CSS, also you can use this button on your website by putting the link.

If you are thinking now how this expanding button actually is, then see the preview given below.

Preview Of Expanding Button

See this video preview to getting an idea of how this button 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 Expand Button On Hover Effect Source Code

Before sharing source code, let’s talk about it. First, I have created a main div named container and placed all elements inside it. After that, I have placed a button tag inside the main div, and placed 3 spans inside the button. First span for circle, second for arrow icon, and the third for text. Also in the HTML file, I have linked the CSS file.

Now using CSS I have placed all the elements in the right place, as you can see in the preview. With CSS, first I gave the circle height, width, and border-radius and created the arrow icon using CSS :before and border, margin commands. There I have used transition for animation effect with cubic-bezier (info). On hover, the circle becomes 100% of width that is the main factor.

Also, I have done many more basic things using CSS that you will understand after getting the codes, I can’t explain all in writing. For creating this program you have to create 2 files one for HTML and one for CSS. 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 Expand Button On Hover Effect, Expanding Button With Icon. If you have any doubt or question comment down below.

Thanks For Visiting, Keep Visiting.

LEAVE A REPLY

Please enter your comment!
Please enter your name here