Skip to content
Related Articles

Related Articles

How to Create Browsers Window using HTML and CSS ?
  • Last Updated : 25 Mar, 2020

The browser window is a tool to view the pages from the internet. It is used to search the content on the internet and get the relevant information from internet.

Creating Structure: In this section, we will create a basic site structure and also attach the CDN link of the Font-Awesome for the icons which will be used as a menu icon.

CDN links for the Icons from the Font Awesome:

  • <link rel=”stylesheet” href=”https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css”>



  • HTML code:




    <!DOCTYPE html>
    <html>
      
    <head>
        <meta name="viewport"
            content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href=
    </head>
      
    <body>
      
        <div class="container">
            <div class="geeks">
                <div class="gfg left">
                    <i class="fa fa-google"
                    aria-hidden="true">oogle</i>
      
                </div>
                  
                <!-- Google icon from font awesome-->
                <div class="gfg middle">
                    <input type="text"
                        value="https://www.geeksforgeeks.org/">
                    <i class="fa fa-search"
                    aria-hidden="true"></i>
                </div>
                <div class="gfg right">
                    <div style="float:right">
                        <span class="bar"></span>
                        <span class="bar"></span>
                        <span class="bar"></span>
                    </div>
                </div>
            </div>
      
            <div class="body">
                <h3>GeeksforGeeks</h3>
                <p>A Computer Science Portal for Geeks</p>
            </div>
        </div>
      
    </body>
      
    </html>                    

Designing Structure: In the previous section, we have created the structure of the basic website where we are going to use as browsers window. In this section, we will design the structure for the browsers window.

  • CSS Code:




    <style>
        * {
            box-sizing: border-box;
        }
      
        /* Container Design */
        .container {
            border: 2px solid #bdc3c7;
            border-top-left-radius: 6px;
            border-top-right-radius: 6px;
        }
          
        .geeks {
            padding: 10px;
            background: #f1f1f1;
            border-top-left-radius: 4px;
            border-top-right-radius: 4px;
        }
          
        /* Input field design */
        input[type=text] {
            width: 100%;
            border-radius: 3px;
            border: none;
            background-color: white;
            margin-top: -8px;
            height: 25px;
            color: gray;
            padding: 5px;
        }
      
        .gfg {
            float: left;
        }
      
        .middle {
            width: 75%;
            position: relative;
        }
      
        .left {
            width: 15%;
        }
          
        .right {
            width: 10%;
        }
          
        .middle i {
            position: absolute;
            left: 430px;
            top: 2px;
            color: gray;
        }
          
        .geeks:after {
            content: "";
            display: table;
            clear: both;
        }
          
        /* Address bar design */
        .bar {
            width: 15px;
            height: 3px;
                    margin: 3px 0;
            display: block;
            background-color: #aaa;
        }
          
        .body {
            padding: 15px;
        }
    </style>

Final Solution: This is the final code after combining the above sections. It will the browsers window.




<!DOCTYPE html>
<html>
  
<head>
    <meta name="viewport" 
          content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href=
    <style>
    * {
        box-sizing: border-box;
    }
   
    /* Container Design */
    .container {
        border: 2px solid #bdc3c7;
        border-top-left-radius: 6px;
        border-top-right-radius: 6px;
    }
       
    .geeks {
        padding: 10px;
        background: #f1f1f1;
        border-top-left-radius: 4px;
        border-top-right-radius: 4px;
    }
       
    /* Input field design */
    input[type=text] {
        width: 100%;
        border-radius: 3px;
        border: none;
        background-color: white;
        margin-top: -8px;
        height: 25px;
        color: gray;
        padding: 5px;
    }
   
    .gfg {
        float: left;
    }
   
    .middle {
        width: 75%;
        position: relative;
    }
   
    .left {
        width: 15%;
    }
       
    .right {
        width: 10%;
    }
       
    .middle i {
        position: absolute;
        left: 430px;
        top: 2px;
        color: gray;
    }
       
    .geeks:after {
        content: "";
        display: table;
        clear: both;
    }
       
    /* Address bar design */
    .bar {
        width: 15px;
        height: 3px;
                margin: 3px 0;
        display: block;
        background-color: #aaa;
    }
       
    .body {
        padding: 15px;
    }
</style>
</head>
  
<body>
  
    <div class="container">
        <div class="geeks">
            <div class="gfg left">
                <i class="fa fa-google" 
                   aria-hidden="true">oogle</i>
  
            </div>
              
            <!-- Google icon from font awesome-->
            <div class="gfg middle">
                <input type="text" 
                       value="https://www.geeksforgeeks.org/">
                <i class="fa fa-search" 
                   aria-hidden="true"></i>
            </div>
            <div class="gfg right">
                <div style="float:right">
                    <span class="bar"></span>
                    <span class="bar"></span>
                    <span class="bar"></span>
                </div>
            </div>
        </div>
  
        <div class="body">
            <h3>GeeksforGeeks</h3>
            <p>A Computer Science Portal for Geeks</p>
        </div>
    </div>
  
</body>
  
</html>

Output:

My Personal Notes arrow_drop_up
Recommended Articles
Page :