Make button transparent

Hello Everyone, In this post we’re going to discuss How we can create a button with transparent background. Yesterday, I created a Linktree like website for my personal use. So, when I’m adding buttons to it, the button background was not looking cool….


This content originally appeared on DEV Community and was authored by Rohit Sharma

Hello Everyone, In this post we're going to discuss How we can create a button with transparent background. Yesterday, I created a Linktree like website for my personal use. So, when I'm adding buttons to it, the button background was not looking cool. So, I decided to remove the background of buttons.

You can also check out my website for better understanding.

Final result

HTML

HTML part is simple we just need a button.

CSS

First of all we need to add a background image to our parent <div> (in my case it is <body>). Then background-repeat:no-repeat and background-size:cover. So, this makes sure that our background-image cover the whole body area.

Now, style the button

button{
background:transparent;
border:none;
}

So, when we set background:transparent the image that we used in<body> becomes visible through button but there is border around the button and we also remove it by using property border:none.

That's it for CSS part. We created our desired button. Now you can add some cool hover effect to make it more attractive(like neon effect).

If you love it♥ then show some love.
Buy Me A Coffee


This content originally appeared on DEV Community and was authored by Rohit Sharma


Print Share Comment Cite Upload Translate Updates
APA

Rohit Sharma | Sciencx (2021-12-16T07:24:45+00:00) Make button transparent. Retrieved from https://www.scien.cx/2021/12/16/make-button-transparent/

MLA
" » Make button transparent." Rohit Sharma | Sciencx - Thursday December 16, 2021, https://www.scien.cx/2021/12/16/make-button-transparent/
HARVARD
Rohit Sharma | Sciencx Thursday December 16, 2021 » Make button transparent., viewed ,<https://www.scien.cx/2021/12/16/make-button-transparent/>
VANCOUVER
Rohit Sharma | Sciencx - » Make button transparent. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/12/16/make-button-transparent/
CHICAGO
" » Make button transparent." Rohit Sharma | Sciencx - Accessed . https://www.scien.cx/2021/12/16/make-button-transparent/
IEEE
" » Make button transparent." Rohit Sharma | Sciencx [Online]. Available: https://www.scien.cx/2021/12/16/make-button-transparent/. [Accessed: ]
rf:citation
» Make button transparent | Rohit Sharma | Sciencx | https://www.scien.cx/2021/12/16/make-button-transparent/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.