HTML structure tutorial: Using <!DOCTYPE html>, <html>, <head>, and <body> for Grade 7
Hey there! π Ever wondered how websites are built? π€ It all starts with something called HTML! It's like the skeleton of a webpage, giving it structure. Let's learn about the basic building blocks: ``, ``, ``, and ``. Trust me, it's easier than it sounds!
HTML (HyperText Markup Language) is the standard language for creating web pages. Think of it as the blueprint for a house. Every webpage starts with a basic structure defined by a few essential tags. Let's explore these tags in detail:
π The `` Declaration
The `` declaration is the very first thing in your HTML document. It tells the browser what version of HTML you're using.
π£ Purpose: Informs the browser that this is an HTML5 document.
βοΈ Syntax: ``
π‘ Note: It's not an HTML tag; it's a declaration. It has no closing tag.
π The `` Tag
The `` tag is the root element of an HTML page. It tells the browser that everything inside it is HTML code.
π Definition: Represents the root of an HTML document.
π¦ Structure: Contains all other HTML elements except the `` declaration.
βοΈ Syntax:
`
...content...
`
The `` Tag
The `
` tag contains meta-information about the HTML document, such as the title, character set, and links to stylesheets.
Title: Defines the title of the document (shown in the browser tab).
Meta: Specifies character set, description, keywords, author, and other metadata.
Link: Links to external style sheets (CSS).
βοΈ Example:
`
My First Webpage
`
The `` Tag
The `
` tag contains the visible page content, such as text, images, links, and other media.
π Content: Everything you see on the webpage goes inside the `` tag.
π Elements: Includes headings, paragraphs, images, links, lists, and more.
βοΈ Example:
`
Welcome to My Webpage!
This is a paragraph of text.
`
π» Example of a Basic HTML Structure
Here's how all these elements come together:
<!DOCTYPE html>
<html>
<head>
<title>My First Webpage</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>This is my first webpage.</p>
</body>
</html>
π‘ Conclusion
Understanding the basic HTML structure with ``, ``, `
`, and `` is crucial for creating web pages. These elements provide the foundation upon which all other content is built. Keep practicing, and you'll be building amazing websites in no time! β¨