HTML Basic Structure
By Tony
2.19.2024
You can't code a webpage without basic structure. They contain all the
information about your webpage. Today, we will explore the basic
structure of an webpage.
Here is an example of the basic HTML structure:
<!DOCTYPE html>
<html>
pcp<head>
pcpcpc<title>My Webpage</title>
pcp</head>
pcp<body>
pcpcpc<h1>Hello World!</h1>
pcp</body>
</html>
- First, we typed the <!DOCTYPE html> tag. It defines, or tells, the browser what language this document is written in (HTML). Always type this tag first in an HTML file.
- Then, we have <html> tags. These tags wrap up all the information and contents in the HTML file.
- Inside the <html> tags, we have the <head> tags. These tags contain all the related information not displayed on the webpage.
- We also have the <body> tags. This is where all the visible elements on the webpage are located.
- Finally, we have the <title> tags inside the <head> tags. The text inside them is displayed on the browser page title like this:
These 5 elements form the basic structure of a webpage. Always remember to put them in your HTML file. In VS Code, open an HTML file then type "!" and hit enter. VS Code will auto complete these tags! Try type in different tags to explore more about these tags.