HTML Foundations - Elements and Tags

CSCI 4513 - Web Programming | Week 2, Class 3

Name: _________________________________ Date: _____________

🎯 Learning Objectives: Understand HTML tags and elements, explore void elements, and see how HTML, CSS, and JavaScript work together

🌐 The Web Development Trinity

Three Languages Working Together

HTML (HyperText Markup Language) provides _________________ and _________________

CSS (Cascading Style Sheets) adds _________________ to HTML elements

JavaScript adds _________________ and makes pages interactive

💡 Remember: HTML and CSS are technically NOT _________________ languages because they don't contain logic - they only handle presentation!

Quick Check - Which Language Would You Use?

  1. To add a paragraph of text: _________________
  2. To change the color of a button: _________________
  3. To make a button do something when clicked: _________________

🏗️ HTML Tags - The Building Blocks

What are HTML Tags?

HTML tags are _________________ wrapped in _________________ brackets

Two Types of Tags:

The main difference between opening and closing tags is the _________________

Practice: Write the opening and closing tags for a paragraph:
Opening: _________________________
Closing: _________________________

📦 HTML Elements - Content + Tags

Anatomy of an HTML Element

An HTML element consists of THREE parts:

  1. _________________ tag
  2. _________________
  3. _________________ tag

Complete this Element:

_______This is my first paragraph!_______

Elements are like _________________ for content - they tell the browser what type of content they contain.

Common HTML Elements

Element Purpose Example
<h1> to <h6> _________________ <h1>Main Title</h1>
<p> _________________ <p>Text content</p>
<a> _________________ <a>Click here</a>
<div> _________________ <div>Content</div>
<span> _________________ <span>Inline text</span>
<ul> _________________ <ul><li>Item</li></ul>

🚫 Void Elements - The Exceptions

What are Void Elements?

Void elements are special because they _________________ have a closing tag

They are called "void" because they are _________________ of content

Common Void Elements - List 4:

  1. _________________ - Line break
  2. _________________ - Image
  3. _________________ - Horizontal rule
  4. _________________ - Form input field
⚠️ Note on Self-Closing Tags:
You might see <br /> or <img /> in older code.
Modern HTML discourages this! Just use _________________ instead.

🎯 Semantic HTML - Why the Right Tag Matters

Benefits of Using Correct Tags:

  1. SEO (Search Engine Optimization):
    _________________________________________
  2. Accessibility:
    _________________________________________
  3. Code Maintainability:
    _________________________________________
Think About It: Why is using <h1> better than <p style="font-size:2em"> for a main heading?

_________________________________________
_________________________________________

⚠️ Common Beginner Mistakes to Avoid

1. Forgetting Closing Tags

❌ Wrong: <p>This won't work properly

✅ Correct: _________________________________________

2. Incorrect Nesting

❌ Wrong: <p><strong>Text</p></strong>

✅ Correct: _________________________________________

3. Using Wrong Elements

List one example of using the wrong element for content:

_________________________________________

💻 Practice Activities

Activity 1: Create These Elements

Write the complete HTML for:

  1. A main heading with the text "Welcome to My Site"
    _________________________________________
  2. A paragraph with any text you choose
    _________________________________________
  3. A line break (void element)
    _________________________________________

Activity 2: Identify the Parts

For this element: <h2>About Me</h2>

📚 Homework Assignment

Due: Before Next Class (Thursday)

Add to your one-page website:

  1. One void tag: _________________
  2. Three new tags you haven't used before:
    1. _________________
    2. _________________
    3. _________________

Submission Steps:

  1. Make your changes in _________________ (which editor?)
  2. Use git command: _________________ to stage changes
  3. Use git command: _________________ to commit with message
  4. Use git command: _________________ to upload to GitHub
  5. Submit the commit link on _________________

✅ Quick Review Questions

  1. What does HTML stand for?
    _________________________________________
  2. What are the three parts of an HTML element?
    _________________________________________
  3. What makes void elements different from regular elements?
    _________________________________________
  4. Why is semantic HTML important? Give two reasons:
    1. _________________________________________
    2. _________________________________________
  5. What symbol indicates a closing tag?
    _________________

📝 Additional Notes

Use this space for any additional notes, questions, or code examples from class:










🎯 Key Takeaways