How to Create Browsers Window using HTML and CSS ? - GeeksforGeeks

08 Aug, 2021
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:  
html
<!DOCTYPE html><html> <head>    <meta name="viewport"        content="width=device-width, initial-scale=1">    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"></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:  
html
<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.  
html
<!DOCTYPE html><html> <head>    <meta name="viewport"          content="width=device-width, initial-scale=1">    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">    <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:  
Supported Browser:
Google Chrome
Microsoft Edge
Firefox
Opera
Safari
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.
ysachin2314
CSS-Misc
HTML-Misc
CSS
HTML
Web Technologies
HTML
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
Top 10 Projects For Beginners To Practice HTML and CSS Skills
How to insert spaces/tabs in text using HTML/CSS?
How to update Node.js and NPM to next version ?
How to create footer to stay at the bottom of a Web page?
Types of CSS (Cascading Style Sheet)
Top 10 Projects For Beginners To Practice HTML and CSS Skills
How to insert spaces/tabs in text using HTML/CSS?
How to Insert Form Data into Database using PHP ?
How to update Node.js and NPM to next version ?
How to set the default value for an HTML <select> element ?