HTML Syntax
HTML Syntax
October 23, 2025
π§ What is HTML?
HTML = HyperText Markup Language
It’s the skeleton of a webpage — it builds the structure of what you see online.
π§© Think of:
- HTML → bones (structure π¦΄)
- CSS → clothes (style π)
- JavaScript → brain (actions π§ )
<!--!+Tab shortcut -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- <meta http-equiv="refresh" content="10">-->
<!-- <meta name="description" content="Learn HTML basics"> -->
<title>Document</title>
<link rel="stylesheet" href="stylesheet.css" />
</head>
<body>
<h1 class="Heading">Hello World</h1>
<script src="javascript.js"></script>
</body>
</html>
π·️ Tags, Elements & Attributes
π§© What’s a Tag?
A tag tells the browser what kind of content something is.
Example:
<p>Hello!</p>
π§ Think of tags as “boxes” with labels.
πΈ Element
A complete pair — opening + content + closing:
<h1>Hello!</h1>
πΉ Attribute
Adds extra info to a tag:
<img src="dog.jpg" alt="A cute dog">
π¬ Trick:
- Tag = “Word”
- Attribute = “Adjective that describes the word”
π¬ Comments
<!-- This is a comment -->
π§ Comments are notes for humans, ignored by the browser.
Shortcut in VS Code:
Ctrl + / (Windows) or Cmd + / (Mac)
Comments
Post a Comment