Hey there, fellow code explorer! π©βπ»
Today, weβre rewinding to the absolute basics β the foundation of every HTML document: <html>, <head>, and <body>.
They may not look flashy, but trust me β these three tags are essential. Theyβre like the backstage crew in a theater π: without them, nothing works properly.
π§± <html> β The Big Wrapper of the Web
This is the outermost tag β the container that wraps your entire web page. It tells the browser, βEverything inside here is HTML β handle with care!β
Example:
<html>
<!-- everything else lives inside here -->
</html>
π Think of it as: The folder that holds all your website content.
π Real-World Insight: Every web page, from Google to Netflix, starts with this tag.
π¨ Visual Aid Idea: Draw a big box labeled <html>, with two internal boxes: one labeled <head> and another labeled <body>.
π€ Quick Prompt: Can you think of what kind of elements should never go outside the <html> tag?
π§ <head> β The Invisible MVP (Most Valuable Player)
The <head> section holds metadata β behind-the-scenes information about your site. While not visible to users, it’s critical for SEO, accessibility, and page behavior.
Inside the <head> youβll usually find:
<title>β What appears in the browser tab<meta>β Info for search engines & screen readers<link>β Connects to CSS files<style>β Embeds internal styles<script>β References JavaScript files
Example:
<head>
<title>Code With Kriti</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="A blog about learning web development from scratch">
<link rel="stylesheet" href="styles.css">
</head>
π¦ Think of it as: The tech team behind the curtains running lights, sound, and SEO magic β¨
π SEO Boost: Tags like <meta name="description"> and <title> help improve your appearance in search results and CTR.
βΏ Accessibility Tip: Always include a proper character set (<meta charset="UTF-8">) and responsive design setup (<meta name="viewport">). It helps screen readers and ensures better rendering.
π¬ Reflect Prompt: How could a missing <meta> tag affect the accessibility or performance of your site?
πΌοΈ <body> β The Star of the Show
The <body> tag is where all the content your visitors interact with lives: text, images, buttons, links, forms β everything visible.
Example:
<body>
<h1>Welcome to Code With Kriti</h1>
<p>This is where I share all my wins (and bugs π) from learning to code.</p>
</body>
π¬ Think of it as: The stage where all the action happens.
π Real-Life Application: Ever filled out a feedback form? Clicked a blog post? Read a heading? Thatβs <body> content β and it needs to be cleanly structured.
β
Accessibility Reminder: Use headings (<h1>, <h2>) in the right order. Label buttons clearly. Don’t forget alt attributes for images.
π‘ Prompt: Try building a simple HTML page with only <body> content. Now add <head> and see what changes!
π Putting It All Together
<!DOCTYPE html>
<html>
<head>
<title>My First Web Page</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>Hello, world!</h1>
<p>Iβm building the web, one tag at a time!</p>
</body>
</html>
π§ͺ Try It Yourself: Want to experiment? Use an online editor like CodePen or Visual Studio Code and recreate this template.
β¨ Wrapping It Up
These three tags β <html>, <head>, and <body> β are the unsung heroes of every web page. They help with structure, performance, discoverability, and accessibility.
β
Clean structure
β
Better SEO
β
Faster load times
β
More accessible content
If youβre just starting out like I am, I hope this gave you a little more clarity (and maybe even a mini βaha!β moment). π
Till tomorrow,
Happy coding β and donβt forget to close your tags properly! π
π For Meta Tags:

Leave a comment