This note is from 8 months ago. You're viewing content from a previous lesson.
At the start of every class, please:
We are going to learn about HTML today -
Every HTML page starts with:
<!DOCTYPE html>
<html>
<head>
<title>My Page</title>
</head>
<body>
<!-- content goes here -->
</body>
</html>
Headings: <h1> to <h6> (biggest to smallest).
Paragraphs: <p> for blocks of text.
Links: <a href="url">Link</a>
Images: <img src="image.jpg" alt="description">
Lists:
Ordered: <ol><li>Item</li></ol>
Unordered: <ul><li>Item</li></ul>
<div> and <span><div> = big container for grouping content.
<span> = small container for inline content.
Example:
<div class="card">
<h2>Title</h2>
<p>Some text</p>
</div>
Extra information inside tags.
Example:
<img src="cat.jpg" alt="A cute cat">
Class = reusable styling group.
ID = unique identifier.
Example:
<div class="alert">Warning!</div>
<div id="main-content">Main Section</div>
Collecting user input.
<form>
<input type="text" placeholder="Your name">
<input type="submit" value="Go">
</form>
Tags go inside each other (parent/child).
Always indent for clarity.
<div>
<p>This is inside a div</p>
</div>