Day 1: Your First Webpage
Welcome to Day 1! Today you'll create your first webpage using HTML. Follow along with the video (you can add it here later), then complete the practice exercises below.
What is HTML?
HTML (HyperText Markup Language) is the structure of every website. Think of it as:
- HTML = structure (walls, floors, rooms)
- CSS = styling (paint, decorations)
- JavaScript = interactivity (making things happen)
HTML uses tags like this: <tagname>content</tagname>
Setup
- Download and install VS Code
- Create a folder called
my-first-website - Open the folder in VS Code
Your First HTML File
Create a file called index.html and add this code:
<!DOCTYPE html>
<html>
<head>
<title>My First Webpage</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>My name is [Your Name].</p>
<p>I'm learning to code!</p>
</body>
</html>
What each part does:
<!DOCTYPE html>β Tells browser this is HTML5<html>β Root element (everything goes inside)<head>β Info about the page (not visible)<title>β Shows in browser tab<body>β Everything visible on the page<h1>β Main heading<p>β Paragraph
index.html in your browser (double-click the file or right-click β Open with browser).Essential HTML Tags
Add these to your <body>:
<h2>Things I'm Learning</h2>
<ul>
<li>HTML - Page structure</li>
<li>CSS - Styling</li>
<li>JavaScript - Interactivity</li>
</ul>
<h2>My Goals</h2>
<ol>
<li>Build my first website</li>
<li>Learn to work with APIs</li>
<li>Share my projects</li>
</ol>
Tags you just learned:
<h2>β Smaller heading<ul>β Unordered list (bullets)<ol>β Ordered list (numbers)<li>β List item
Adding Images
Images make your webpage more interesting! The <img> tag is special β it doesn't have a closing tag.
<h2>My Photo</h2>
<img src="profile.jpg" alt="My profile picture"/>
Important attributes:
srcβ The image file path or URLaltβ Description of the image (shows if image can't load, used by screen readers)
Where to get images:
- Save an image in the same folder as your
index.html - Use a URL from the web:
<img src="https://example.com/image.jpg" alt="Description"> - Free stock photos: Unsplash or Pexels
Example with a web image:
<img src="https://images.unsplash.com/photo-1517694712202-14dd9538aa97" alt="Laptop with code" width="400"/>
The width attribute controls the image size (optional).
Practice Exercises
- Add an
<h2>heading with your own topic - Create a list (ul or ol) with at least 3 items about yourself
- Add 2β3 paragraphs about why you're learning to code
- Challenge: Add anchor tags (
<a>) to create links:- Link to your favorite website:
<a href="https://example.com">Link text</a> - Try adding
target="_blank"to open in a new tab
- Link to your favorite website:
DevTools Tip
Right-click your page β βInspectβ (or press F12) to see the HTML structure in DevTools. You'll use this constantly!
Common Mistakes
- Forgetting closing tags β Every
<tag>needs</tag> - Typos in tag names β Must be spelled exactly right
- Nesting incorrectly β Tags must close in reverse order they opened
Key Takeaways
β HTML tags describe content structure
β Tags open and close: <tag>content</tag>
β Your webpage lives in the <body> section
Tomorrow: Add CSS to make it look professional!
Before Day 2: Make sure index.html is saved and opens in your browser.
Additional Resources
- MDN CSS Documentation β Comprehensive reference & tutorials
- VS Code Keyboard Shortcuts Guide