How to Put or Wrap Button Tag as a Nested Child Element inside Anchor (a) Link Tag to Make it Clickable Using HTML5 Full Project For Beginners

 

Welcome folks today in this blog post we will be putting or wrapping button tag as a nested child element inside anchor (a) link tag to make it clickable  in browser.All the full source code of the application is given below.

 

 

 

Get Started

 

 

 

In order to get started you need to make an index.html file and copy paste the following code

 

 

index.html

 

 

<!DOCTYPE html>
<html>
    
<head>
    <title>
        Create an HTML button that
        acts like a link
    </title>
    
    <!-- Style to create button -->
    <style>
        .GFG {
            background-color: white;
            border: 2px solid black;
            color: green;
            padding: 5px 10px;
            text-align: center;
            display: inline-block;
            font-size: 20px;
            margin: 10px 30px;
            cursor: pointer;
        }
    </style>
</head>

<body>
    <h1>GeeksforGeeks</h1>
    
    <!-- Adding button inside the link tag -->
    <a href='https://ide.geeksforgeeks.org/'>
        <button class="GFG">
            Click Here
        </button>
    </a>
</body>

</html>

Leave a Reply