HTML Basic Structure
By Tony 2023.3.1
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 <!DOCTYPE html> tag. It defines, or tells browser, what language this document is written in (HTML). Always type this tag first in HTML file.
- Then, we have <html> tags. These tags wrap up all the information and contents in the file.
- Inside the <html> tags, we have the <head> tags. These tags contain all information not displayed on the webpage.
- We also have the <body> tags. All elements inside these tags are displayed on the webpage.
- Finally, we have the <title> tags. The text inside them is displayed on the browser page title like the "New Tab" below:
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.