How to Create Windows 11 Interface using HTML5 ?
Last Updated :
23 Jul, 2024
In this article, we will see how to create a Windows 11 interface using HTML5.
Approach: To create Windows 11 interface we will use HTML, CSS, and JavaScript. If you want to change to design you can add more functionality to it. In this article, we will divide the whole thing into three different parts creating the structure, styling the structure, and adding functionality.
Below is the step-by-step implementation of the above approach.
Step 1: In this section, we will create the basic structure using HTML for the Windows 11 interface. We will give the title as "Try Windows 11" and add necessary images using <img> tag. Also, add the necessary links using the <link> tag.
- HTML Code: This code is used to add images and links to structure the website. It doesn't have any CSS properties. We will create various div using the <div> tag and give them respective class names.
Example: In this example, we will create Windows 11 interface using HTML5.
HTML
<!DOCTYPE html>
<html>
<head>
<title>Try Windows 11</title>
<link rel="shortcut icon"
href=
"https://media.geeksforgeeks.org/wp-content/uploads/20210914203818/faviconWindows.png"
type="image/x-icon">
<!-- Linking the CSS stylesheet -->
<link rel="stylesheet"
href="styles.css">
</head>
<body>
<div class="taskbar">
<img src=
"https://media.geeksforgeeks.org/wp-content/uploads/20210914203932/icons-300x37.PNG"
alt="">
<img class="right"
src=
"https://media.geeksforgeeks.org/wp-content/uploads/20210914204052/taskbar-200x37.PNG"
alt="">
</div>
<div class="startmenu">
<img src=
"https://media.geeksforgeeks.org/wp-content/uploads/20210914204232/startmenu-289x300.PNG"
alt="">
</div>
<div class="wallpaper">
<img src=
"https://media.geeksforgeeks.org/wp-content/uploads/20210914204725/windows11-300x169.jpg"
alt="">
</div>
<!-- Linking the external JavaScript -->
<script src="script.js"></script>
</body>
</html>
Step 2: Styling the Structure: In the previous section, we created the structure of the Windows 11 interface. Now we will add some CSS properties to it. Different classes will have different properties.
The class named taskbar will have CSS properties such as:
- background-color: #f3f3f3; (sets the background color of an element).
- width: 100%; (sets the width of the element)
- position: absolute; (sets the position of the element and specifies the positioning method used for the element)
- bottom: 0; (affects the vertical position of the positioned element).
- display: flex; (specifies the display behavior (the type of rendering box) of an element).
- z-index: 110; (specifies the stack order of an element).
- justify-content: center; (aligns the flexible container's items when the items do not use all available space on the main-axis horizontally)
The class named right will have CSS properties such as:
- justify-self: flex-end; (sets the way a box is justified inside its alignment container along the appropriate axis).
- position: absolute; (sets the position of the element and specifies the positioning method used for the element).
- right: 0; (affects the horizontal position of the given elements).
- margin: 6px 0; (creates spacing around the elements).
- height: 85%; (sets the height of an element).
Class named startmenu will have CSS properties such as:
- position: absolute; (specifies the type of positioning method used for an element).
- bottom: -655px; (affects the vertical position of a positioned element).
- width: 100%; (sets the width of an element).
- text-align: center; (specifies the horizontal alignment of text in an element).
- transition: all 0.3s ease-in; (allows to change property values smoothly, over a given duration).
CSS
body{
overflow: hidden;
height: 100vh;
}
.taskbar{
background-color: #F3F3F3;
width: 100%;
position: absolute;
bottom: 0;
display: flex;
z-index: 110;
justify-content: center;
}
.right{
justify-self: flex-end;
position: absolute;
right: 0;
margin: 6px 0;
height: 85%;
}
.startmenu{
position: absolute;
bottom: -655px;
width: 100%;
text-align: center;
transition: all 0.3s ease-in;
}
.startmenu img{
border-radius: 8px;
}
.wallpaper img{
height: 900px;
}
Step 3: Add functionality to the website: We will write the JavaScript for the start menu and taskbar. First we will create two variables named taskbar and startmenu then inside this variable we will use the document.getElementsByClassName() method which returns a collection of all elements in the document with the specified class name, as an HTMLCollection object.
Now in the taskbar, we will add an event listener for a click that attaches an event handler to the document, and inside it, we will create an if-else statement such as if the bottom property of startmenu is 50px then update it into -655px else if it is not 50px update it into 50px. This will make the taskbar responsive.
JavaScript
let taskbar = document.getElementsByClassName("taskbar")[0]
let startmenu = document.getElementsByClassName("startmenu")[0]
taskbar.addEventListener("click", ()=>{
console.log("clicked");
if(startmenu.style.bottom == "50px"){
startmenu.style.bottom = "-655px"
}
else{
startmenu.style.bottom = "50px"
}
})
Output:
Similar Reads
How to create table cell using HTML5 ?
In this article, we will create cell in a table by using a combination of <tr> and <td> tag in a HTML table. Syntax: <table> <tr> <td> . . . </td> <td> . . . </td> </tr> </table> Example: html <!DOCTYPE html> <html> <head>
1 min read
How to create windows loading effect using HTML and CSS ?
In this article, we are going to create a window loading effect before the lock screen appears using HTML and CSS. Glimpse of the Windows Loading Effect: Approach: Create an HTML file that contains HTML div in which we are giving the loader effect.Then we create 5 span elements which are used for c
4 min read
How to create an inline frame using HTML5 ?
In this article, we will create an inline iframe by using a <iframe> tag in a document. It represents a fixed rectangular area within the document in which the browser can display a separate document along with scroll bars and borders. Inline frames are used to embed another document within th
1 min read
How to Create Browsers Window using HTML and CSS ?
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 relevant information from the 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
3 min read
How to create a dialog box or window in HTML ?
In this article, we will create a dialog box or window using the <dialog> tag in the document. This tag is used to create popup dialog and models on a web page. This tag is new in HTML5. Syntax: <dialog open> Contents... </dialog> Example 1: html <!DOCTYPE html> <html>
1 min read
How to Create iPod Template using HTML and CSS ?
The iPod template will create the look and feel of a classic iPod, with a sleek design and functional layout. The code creates a visually appealing iPod-like template with responsive design features and FontAwsome icons are used to enhance the look of the project. PreviewApproachFirst, create the st
3 min read
How to Create Navigation Links using HTML5 ?
In this article, we create a navigation link by using the <nav> tag in the document. The nav element represents a section of the page whose purpose is to provide navigational links, either in the current document or to other documents. The links in the "nav" element may point to other webpages
1 min read
How to create form validation by using only HTML ?
In Web Development, we often use JavaScript with HTML to validate the form, but we can also do the same via HTML in the following ways. HTML <input> required Attribute HTML <input> type Attribute HTML <input> pattern Attribute HTML <input> required Attribute: In input tag of
2 min read
How to Use Widgets in Windows 11?
Windows 11 offers new features that are designed to improve user experience and productivity to implement any ideas and system configurations. The Widgets panel is one of these elements that jump out as being very useful to the users for delivering personalized contentâlike news, weather, calendar e
5 min read
How to Create a Website Using HTML and CSS?
Creating a website using HTML and CSS is a foundational skill if you are learning web development. HTML (HyperText Markup Language) is used to structure content, while CSS (Cascading Style Sheets) is used for styling, including colors, fonts, margins, and positioning. In this article, weâll go throu
5 min read