Skip to main content

Create a side Bar

 Create a Side Bar in HTML

Creating a sidebar is pretty cool easy to understand.

If you don't understand anything, feel free to comment or message me.

CODE


<!DOCTYPE html>
<html>
    <head>
        <title>Creating a side bar</title>
    </head>
    <body>
        <div id="nav">
        <div id="nav_open">&#9776;</div>
        <div id="nav_con">
            <a href="#">Link1</a>
            <a href="#">Link2</a>
            <a href="#">Link3</a>
        </div>
        </div>
        <style>
            #nav_open{
                font-size: 30px;/*for making it big*/
            }
            #nav_con{
                display: flex;
                flex-direction: column;/*to make it display in a vertical direction*/
                padding:0;
                background-color: rgba(0,0,0,0.5); /*for look through*/
                width: 70vw;
                position: fixed;
                left:-100vw;
                transition: all 1s;
            }
            #nav_con a{
                text-decoration: none;/*to remove the underline*/
                margin:10px;
                color:white;
            }
            #nav:hover #nav_con{
                left:0;
            }
            #nav{
                position: relative;
                display: inline-block;
            }
        </style>
    </body>
</html>

OUTPUT


Comments

Popular posts from this blog

Creating A calculator using html

CREATE A SIMPLE CALCULATOR USING HTML Creating a calculator is one of the most recommended beginner's project. Hence, I decided to make it my first post. First I created the table so that all the buttons are placed in a tabular form. Then the form, so that all the buttons works perfectly. Then, I added the styling using Css  And Lastly, I added the Scripting to make the buttons functional. The scriptings are All in the onclick event attribute.         <center><form name="calculator">    <table>       <tr>          <td colspan="6">            <input type="text" name="display" id="display"placeholder="0"disabled>                      </td>       </tr>       <tr>             <td><input type="button" nam...