Terrarium Project Part 1: Introduction to HTML
HTML, or HyperText Markup Language, is the foundation of every website you’ve ever visited. Think of HTML as the skeleton that gives structure to web pages – it defines where content goes, how it’s organized, and what each piece represents. While CSS will later “dress up” your HTML with colors and layouts, and JavaScript will bring it to life with interactivity, HTML provides the essential structure that makes everything else possible. In this lesson, you’ll create the HTML structure for a virtual terrarium interface. This hands-on project will teach you fundamental HTML concepts while building something visually engaging. You’ll learn how to organize content using semantic elements, work with images, and create the foundation for an interactive web application. By the end of this lesson, you’ll have a working HTML page displaying plant images in organized columns, ready for styling in the next lesson. Don’t worry if it looks basic at first – that’s exactly what HTML should do before CSS adds the visual polish.
Pre-Lecture Quiz
Pre-lecture quiz
Setting Up Your Project
Before we dive into HTML code, let’s set up a proper workspace for your terrarium project. Creating an organized file structure from the beginning is a crucial habit that will serve you well throughout your web development journey.
Task: Create Your Project Structure
You’ll create a dedicated folder for your terrarium project and add your first HTML file. Here are two approaches you can use: Option 1: Using Visual Studio Code 1. Open Visual Studio Code 2. Click “File” → “Open Folder” or use Ctrl+K, Ctrl+O (Windows/Linux) or Cmd+K, Cmd+O (Mac) 3. Create a new folder called terrarium and select it 4. In the Explorer pane, click the “New File” icon 5. Name your file index.html Option 2: Using Terminal Commands Here’s what these commands accomplish: - Creates a new directory called terrarium for your project - Navigates into the terrarium directory - Creates an empty index.html file - Opens the file in Visual Studio Code for editing
Understanding HTML Document Structure
Every HTML document follows a specific structure that browsers need to understand and display correctly. Think of this structure like a formal letter – it has required elements in a particular order that help the recipient (in this case, the browser) process the content properly. Let’s start by adding the essential foundation that every HTML document needs.
The DOCTYPE Declaration and Root Element
The first two lines of any HTML file serve as the document’s “introduction” to the browser: Understanding what this code does: - Declares the document type as HTML5 using <!DOCTYPE html> - Creates the root element that will contain all page content - Establishes modern web standards for proper browser rendering - Ensures consistent display across different browsers and devices
🔄 Pedagogical Check-in
Pause and Reflect: Before continuing, make sure you understand: - ✅ Why every HTML document needs a DOCTYPE declaration - ✅ What the root element contains - ✅ How this structure helps browsers render pages correctly Quick Self-Test: Can you explain in your own words what “standards-compliant rendering” means?
Adding Essential Document Metadata
The
section of an HTML document contains crucial information that browsers and search engines need, but that visitors don’t see directly on the page. Think of it as the “behind-the-scenes” information that helps your webpage work properly and appear correctly across different devices and platforms. This metadata tells browsers how to display your page, what character encoding to use, and how to handle different screen sizes – all essential for creating professional, accessible web pages.Task: Add the Document Head
Insert this
section between your opening and closing tags: Breaking down what each element accomplishes: - Sets the page title that appears in browser tabs and search results - Specifies UTF-8 character encoding for proper text display worldwide - Ensures compatibility with modern versions of Internet Explorer - Configures responsive design by setting the viewport to match device width - Controls initial zoom level to display content at natural sizeBuilding the Document Body
The
element contains all the visible content of your webpage – everything users will see and interact with. While the section provided instructions to the browser, the section contains the actual content: text, images, buttons, and other elements that create your user interface. Let’s add the body structure and understand how HTML tags work together to create meaningful content.Understanding HTML Tag Structure
HTML uses paired tags to define elements. Most tags have an opening tag like
and a closing tag like
, with content in between:Hello, world!
. This creates a paragraph element containing the text “Hello, world!”.Task: Add the Body Element
Update your HTML file to include the
element: Here’s what this complete structure provides: - Establishes the basic HTML5 document framework - Includes essential metadata for proper browser rendering - Creates an empty body ready for your visible content - Follows modern web development best practices Now you’re ready to add the visible elements of your terrarium. We’ll useWorking with Images and Layout Containers
Images are special in HTML because they use “self-closing” tags. Unlike elements like
that wrap around content, theTask: Create the Plant Display Layout
Now add the plant images organized in two columns between your
tags: Step by step, here’s what’s happening in this code: - Creates a main page container with id=“page” to hold all content - Establishes two column containers: left-container and right-container - Organizes 7 plants in the left column and 7 plants in the right column - Wraps each plant image in a plant-holder div for individual positioning - Applies consistent class names for CSS styling in the next lesson - Assigns unique IDs to each plant image for JavaScript interaction later - Includes proper file paths pointing to the images folder🔄 Pedagogical Check-in
Structure Understanding: Take a moment to review your HTML structure: - ✅ Can you identify the main containers in your layout? - ✅ Do you understand why each image has a unique ID? - ✅ How would you describe the purpose of the plant-holder divs? Visual Inspection: Open your HTML file in a browser. You should see: - A basic list of plant images - Images organized in two columns - Simple, unstyled layout Remember: This plain appearance is exactly what HTML should look like before CSS styling! With this markup added, the plants will appear on screen, though they won’t look polished yet – that’s what CSS is for in the next lesson! For now, you have a solid HTML foundation that properly organizes your content and follows accessibility best practices.
Using Semantic HTML for Accessibility
Semantic HTML means choosing HTML elements based on their meaning and purpose, not just their appearance. When you use semantic markup, you’re communicating the structure and meaning of your content to browsers, search engines, and assistive technologies like screen readers. This approach makes your websites more accessible to users with disabilities and helps search engines better understand your content. It’s a fundamental principle of modern web development that creates better experiences for everyone.
Adding a Semantic Page Title
Let’s add a proper heading to your terrarium page. Insert this line right after your opening
tag: Why semantic markup matters: - Helps screen readers navigate and understand page structure - Improves search engine optimization (SEO) by clarifying content hierarchy - Enhances accessibility for users with visual impairments or cognitive differences - Creates better user experiences across all devices and platforms - Follows web standards and best practices for professional development Examples of semantic vs. non-semantic choices:Creating the Terrarium Container
Now let’s add the HTML structure for the terrarium itself – the glass container where plants will eventually be placed. This section demonstrates an important concept: HTML provides structure, but without CSS styling, these elements won’t be visible yet. The terrarium markup uses descriptive class names that will make CSS styling intuitive and maintainable in the next lesson.
Task: Add the Terrarium Structure
Insert this markup above the last
🔄 Pedagogical Check-in
HTML Structure Mastery: Before moving forward, ensure you can: - ✅ Explain the difference between HTML structure and visual appearance - ✅ Identify semantic vs. non-semantic HTML elements - ✅ Describe how proper markup benefits accessibility - ✅ Recognize the complete document tree structure
Testing Your Understanding: Try opening your HTML file in a browser with JavaScript disabled and CSS removed. This shows you the pure semantic structure you’ve created!
GitHub Copilot Agent Challenge
Use the Agent mode to complete the following challenge:
Description: Create a semantic HTML structure for a plant care guide section that could be added to the terrarium project.
Prompt: Create a semantic HTML section that includes a main heading “Plant Care Guide”, three subsections with headings “Watering”, “Light Requirements”, and “Soil Care”, each containing a paragraph of plant care information. Use proper semantic HTML tags like to structure the content appropriately.
Learn more about agent mode here. Learning About Web Evolution
HTML has evolved significantly since Tim Berners-Lee created the first web browser at CERN in 1990. Some older tags like Post-lecture quiz Deepen Your HTML Knowledge
HTML has been the foundation of the web for over 30 years, evolving from a simple document markup language to a sophisticated platform for building interactive applications. Understanding this evolution helps you appreciate modern web standards and make better development decisions.
Recommended Learning Paths:
1. HTML History and Evolution
- Research the timeline from HTML 1.0 to HTML5
- Explore why certain tags were deprecated (accessibility, mobile-friendliness, maintainability)
- Investigate emerging HTML features and proposals
2. Semantic HTML Deep Dive
- Study the complete list of HTML5 semantic elements
- Practice identifying when to use [ ] Open DevTools (F12) and inspect the HTML structure of your favorite website [ ] Create a simple HTML file with basic tags: , and [ ] Validate your HTML using the W3C HTML Validator online [ ] Try adding a comment to your HTML using [ ] Complete the post-lesson quiz and review semantic HTML concepts [ ] Build a simple webpage about yourself using proper HTML structure [ ] Experiment with different heading levels and text formatting tags [ ] Add images and links to practice multimedia integration [ ] Research HTML5 features you haven’t tried yet [ ] Complete the terrarium project assignment with semantic markup [ ] Create an accessible webpage using ARIA labels and roles [ ] Practice form creation with various input types [ ] Explore HTML5 APIs like localStorage or geolocation [ ] Study responsive HTML patterns and mobile-first design [ ] Review other developers’ HTML code for best practices [ ] Build a portfolio website showcasing your HTML mastery [ ] Learn HTML templating with a framework like Handlebars [ ] Contribute to open source projects by improving HTML documentation [ ] Master advanced HTML concepts like custom elements [ ] Integrate HTML with CSS frameworks and JavaScript libraries [ ] Mentor others learning HTML fundamentals After completing this lesson, you now have: Document Structure: Complete HTML5 foundation with proper DOCTYPE Semantic Markup: Meaningful tags that enhance accessibility and SEO Image Integration: Proper file organization and alt text practices Layout Containers: Strategic use of divs with descriptive class names Accessibility Awareness: Understanding of screen reader navigation Modern Standards: Current HTML5 practices and deprecated tag knowledge Project Foundation: Solid base for CSS styling and JavaScript interactivity
Next Steps: Your HTML structure is ready for CSS styling! The semantic foundation you’ve built will make the next lesson much easier to understand. Practice your HTML: Build a blog mockup Follow the lesson from Microsoft Web-Dev-For-Beginners course,
, and
Explore HTML History Challenge
Post-Lecture Quiz
Review & Self Study
⚡ What You Can Do in the Next 5 Minutes
,
🎯 What You Can Accomplish This Hour
📅 Your Week-Long HTML Journey
🌟 Your Month-Long Web Foundation
🎯 Your HTML Mastery Timeline
🛠️ Your HTML Toolkit Summary
Assignment
journey
title Your HTML Learning Journey
section Foundation
Create HTML file: 3: Student
Add DOCTYPE: 4: Student
Structure document: 5: Student
section Content
Add metadata: 4: Student
Include images: 5: Student
Organize layout: 5: Student
section Semantics
Use proper tags: 4: Student
Enhance accessibility: 5: Student
Build terrarium: 5: Student