
- CSS Tutorial
- CSS - Home
- CSS - Introduction
- CSS - Syntax
- CSS - Inclusion
- CSS - Measurement Units
- CSS - Colors
- CSS - Backgrounds
- CSS - Fonts
- CSS - Text
- CSS - Images
- CSS - Links
- CSS - Tables
- CSS - Borders
- CSS - Margins
- CSS - Lists
- CSS - Padding
- CSS - Cursors
- CSS - Outlines
- CSS - Dimension
- CSS - Scrollbars
- CSS Advanced
- CSS - Visibility
- CSS - Positioning
- CSS - Layers
- CSS - Pseudo Classes
- CSS - Pseudo Elements
- CSS - @ Rules
- CSS - Text Effects
- CSS - Media Types
- CSS - Paged Media
- CSS - Aural Media
- CSS - Printing
- CSS - Layouts
- CSS - Validations
- CSS3 Tutorial
- CSS3 - Tutorial
- CSS3 - Rounded Corner
- CSS3 - Border Images
- CSS3 - Multi Background
- CSS3 - Color
- CSS3 - Gradients
- CSS3 - Shadow
- CSS3 - Text
- CSS3 - Web font
- CSS3 - 2d transform
- CSS3 - 3d transform
- CSS3 - Animation
- CSS3 - Multi columns
- CSS3 - User Interface
- CSS3 - Box Sizing
- CSS Responsive
- CSS - Responsive Web Design
- CSS References
- CSS - Questions and Answers
- CSS - Quick Guide
- CSS - References
- CSS - Color References
- CSS - Web browser References
- CSS - Web safe fonts
- CSS - Units
- CSS - Animation
- CSS Resources
- CSS - Useful Resources
- CSS - Discussion
How to create a browser window example with CSS?
To create a browser window example with CSS, the code is as follows −
Example
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } * { box-sizing: border-box; } .menuBar { border: 3px solid #f1f1f1; border-top-left-radius: 4px; border-top-right-radius: 4px; } .menuRow { padding: 10px; background: #f1f1f1; border-top-left-radius: 4px; border-top-right-radius: 4px; } .browserField { float: left; } .left { width: 15%; } .right { width: 10%; } .middle { width: 75%; } .menuRow:after { content: ""; display: table; clear: both; } .menuBarDots { margin-top: 4px; height: 12px; width: 12px; background-color: #bbb; border-radius: 50%; display: inline-block; } input[type=text] { width: 100%; border-radius: 3px; border: none; background-color: white; margin-top: -8px; height: 25px; color: #666; padding: 5px; } .menuDots { width: 5px; height: 5px; background-color: #aaa; margin: 3px 0; display: block; border-radius: 50%; } .content { padding: 10px; } </style> </head> <body> <div class="menuBar"> <div class="menuRow"> <div class="browserField left"> <span class="menuBarDots" style="background:#ED594A;"></span> <span class="menuBarDots" style="background:#FDD800;"></span> <span class="menuBarDots" style="background:#5AC05A;"></span> </div> <div class="browserField middle"> <input type="text" value="https://demo.com/"> </div> <div class="browserField right"> <div style="float:right"> <span class="menuDots"></span> <span class="menuDots"></span> <span class="menuDots"></span> </div> </div> </div> <div class="content"> <h1>Sample Text</h1> <h2>Welcome to our website</h2> </div> </div> </body> </html>
Output
The above code will produce the following output −
- Related Articles
- How to create a popup chat window with CSS and JavaScript?
- How to stretch elements to fit the whole height of the browser window with CSS?
- How to Resize Browser Window in WebDriver?
- How to open a browser window in full screen using Selenium WebDriver with C#?
- How to avoid the pop-up window in chrome browser with Selenium?
- How to close a current tab in a browser window using JavaScript?
- How to create a pagination with CSS?
- How to create a Calendar with CSS?
- How to create a preloader with CSS?
- How to create a "card" with CSS?
- How to create a "coupon" with CSS?
- How to create a transition effect with CSS?
- How to create a Menu Icon with CSS?
- How to create a Hoverable Sidenav with CSS?
- How to create a vertical menu with CSS?

Advertisements