HTML - Structure
query_builder | Christopher PisaniThe HTML page consists of two main sections, the <head> and the <body>.
In the <head> section, we serve information about the website :
- <title> - Web Page Title
- <style> - Web Page Styling (CSS)
- <base> - Specifies a default URL and a default target for links on a page
- <link> - Links to an external CSS style sheet
- <meta> - Assigns metadata about the HTML page
- <script> - JavaScript code or link to external JavaScript page
The <body> represents the visual content of the HTML document. An example of a representation of the body, can be seen in the image below.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Sample page</title>
<style>
body {
width:100%;
padding:0;
margin:0;
}
header {
width:100%;
height:20%;
background-color:pink;
float:left;
}
aside {
width:25%;
height:60%;
background-color:yellow;
float:left;
margin:0;
padding:0
}
main {
width:75%;
height:60%;
background-color:lightgreen;
float:left;
margin:0;
padding:0
}
footer {
width:100%;
height:20%;
background-color:lightblue;
float:left;
}
</style>
</head>
<body>
<header>Header</header>
<aside>Aside</aside>
<main>Main</main>
<footer>Footer</footer>
</body>
</html>