How to Create a Transparent button using HTML and CSS ?

The transparent button can be easily created by using HTML and CSS. In this article, we will use background-color: transparent; property to design the transparent background button.

HTML Code: In this section, we will create a basic structure of button using the button Tag.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html lang="en">
  
<head>
    <meta charset="utf-8">
    <title>
        Create a Transparent button
        using HTML and CSS
    </title>
</head>
  
<body>
    <h1>GeeksforGeeks</h1>
  
    <h3>
        Create a Transparent button
        using HTML and CSS
    </h3>
  
    <button class="btn">Click me!</button>
</body>
  
</html>

chevron_right


CSS Code: In this section, we will design the button using CSS property. We will use the background-color: transparent; property to set the button with transparent look.

filter_none

edit
close

play_arrow

link
brightness_4
code

<style>
    body {
        margin: 0;
        padding: 0;
        text-align: center;
    }
  
    h1 {
        color: green;
    }
  
    /* Styling the button */
    .btn {
        cursor: pointer;
        border: 1px solid #3498db;
        background-color: transparent;
        height: 50px;
        width: 200px;
        color: #3498db;
        font-size: 1.5em;
        box-shadow: 0 6px 6px rgba(0, 0, 0, 0.6);
    }
</style>

chevron_right


Complete Code: In this section, we will combine the above two sections to create a transparent background button.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html lang="en">
  
<head>
    <meta charset="utf-8">
    <title></title>
  
    <style>
        body {
            margin: 0;
            padding: 0;
            text-align: center;
        }
  
        h1 {
            color: green;
        }
  
        /* Styling the button */
        .btn {
            cursor: pointer;
            border: 1px solid #3498db;
            background-color: transparent;
            height: 50px;
            width: 200px;
            color: #3498db;
            font-size: 1.5em;
            box-shadow: 0 6px 6px rgba(0, 0, 0, 0.6);
        }
    </style>
</head>
  
<body>
    <h1>GeeksforGeeks</h1>
  
    <h3>
        Create a Transparent button
        using HTML and CSS
    </h3>
  
    <button class="btn">Click me!</button>
</body>
  
</html>

chevron_right


Output:

full-stack-img




My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.