Every webpage follows a basic structure in HTML. Understanding this structure is important because it tells the browser how to display the content.
1. <!DOCTYPE html>
Declares the type of document.
Tells the browser we are using HTML5.
Always written at the top of the page.
2. <html> Tag
The root element that wraps all content on the page.
Every webpage starts with <html> and ends with </html>.
3. <head> Section
Contains metadata (information about the page).
Includes the page <title>, links to CSS, JavaScript, fonts, etc.
Not directly visible on the webpage.
4. <body> Section
Holds the visible content of the page (headings, paragraphs, images, links, etc.).
Everything users see on the screen is inside <body>.
Basic Example:
Summary
<!DOCTYPE html> → defines the document type as HTML5.
<html> → the root element containing everything.
<head> → holds metadata (title, styles, scripts).
<body> → displays visible content (text, images, links).