Working with Text - Guided Notes

CSCI 4513 - Web Programming | Week 3, Class 5

Name: _________________________________ Date: _____________

πŸ“ Today's Focus: Making text meaningful and beautiful in HTML!

🎯 Learning Objectives

By the end of this class, I will be able to:

πŸ€” The Whitespace Problem

What happens to multiple spaces and line breaks in HTML?

Browsers _________________ all whitespace into _________________ space!

Example: What will this display?
<body> Lorem ipsum dolor sit amet. Ut enim ad minim veniam. </body>

Result: _________________________________________

Solution: We need HTML _________________ to structure our text!

ΒΆ Paragraph Elements

Creating Paragraphs

The paragraph tag: _______

<_____> <_____>First paragraph of text</_____> <_____>Second paragraph of text</_____> </body>
πŸ’‘ VS Code Tip: Type __________ + Enter to generate Lorem Ipsum text!
Quick Practice: Add 3 paragraphs to your website
β–‘ Paragraph 1: ________________________________
β–‘ Paragraph 2: ________________________________
β–‘ Paragraph 3: ________________________________

πŸ“° HTML Headings

Six Levels of Headings

Tag Purpose Size
<h1> _________________________ Largest
<h2> _________________________ ↓
<h3> _________________________ ↓
<h4> Sub-subsection ↓
<h5> Minor heading ↓
<h6> Smallest heading Smallest
⚠️ Important Rule: Only _______ h1 per page!

Proper Heading Hierarchy

βœ… Good Structure:

❌ Never skip levels! (Don't go from h1 β†’ h3)

✨ Text Formatting Elements

Making Text Bold: <strong>

Purpose: Makes text _________________ AND _________________

<p>This is <________>important</________> text!</p>

Adding Emphasis: <em>

Purpose: Makes text _________________ AND _________________

<p>I <_____>really</_____> love coding!</p>

Combining Elements

<p><strong><em>Warning:</em></strong> This is bold AND italic!</p>
πŸ’‘ Remember: These tags add _________________ meaning, not just styling!

πŸͺ† Nesting and Element Relationships

HTML Family Tree

<body> <!-- Parent --> <div> <!-- Child of body, Parent of h2 & p --> <h2>Title</h2> <!-- Sibling 1 --> <p>Text</p> <!-- Sibling 2 --> </div> </body>

Fill in the relationships:

Indentation Best Practices

Standard indentation: _____ spaces per nesting level

Alternative: _____ spaces (just be consistent!)

Practice: Properly indent this code:
<body> <header> <h1>Title</h1> </header> <main> <p>Content</p> </main> </body>

πŸ’­ HTML Comments

Comment Syntax

Opening: __________

Closing: __________

_______ This is a comment _______ _______ Multi-line comment _______

VS Code Shortcut

Windows/Linux: __________ + _____

Mac: __________ + _____

Good Uses for Comments

πŸ“ Blog Article Practice

Create a blog article with these requirements:

Your Article Checklist:

⚠️ Common Mistakes to Avoid

Mistake Why It's Wrong Correct Approach
Multiple h1 tags _________________________ _________________________
Skipping heading levels _________________________ _________________________
Using <strong> just for bold _________________________ _________________________
No indentation _________________________ _________________________

πŸ“‹ Quick Reference

Essential Text Elements

Element Tag Purpose
Paragraph <p> Text blocks
Main Heading <h1> Page title (only one!)
Section Headings <h2>-<h6> Content hierarchy
Bold/Important <strong> Important text
Italic/Emphasis <em> Emphasized text
Comment <!-- --> Hidden notes

πŸ“š Homework Assignment

Due: Before Next Class (Thursday)

  1. Watch Kevin Powell's HTML Paragraph and Headings Video
    Notes: _________________________________________
  2. Watch Kevin Powell's HTML Bold and Italic Text Video
    Notes: _________________________________________
  3. Create a complete blog article page with:
    • β–‘ Proper heading hierarchy
    • β–‘ Multiple paragraphs
    • β–‘ Bold and italic text
    • β–‘ HTML comments
  4. Add AT LEAST 3 different text tags to your one-page website:
    Tag 1: _________ Tag 2: _________ Tag 3: _________
⚠️ Don't forget: Push to GitHub and submit link on D2L!

πŸ“ Additional Notes

Use this space for any additional notes during the lecture:










πŸ”‘ Key Takeaways

  1. HTML is about _________________, not appearance
  2. Browsers compress _________________ into single spaces
  3. Only use _______ h1 per page
  4. Don't skip _________________ levels
  5. <strong> and <em> add _________________ meaning
  6. Proper _________________ makes code readable
  7. Comments are for _________________, not users