Midterm Review - Guided Notes

CSCI 3403 - Web Programming | Week 8, Class 15

Name: _________________________________ Date: _____________

📚 Extra Credit Reminder: Add a README to your GitHub profile (Due before midterm)

🏗️ HTML Foundations

What is HTML?

HTML stands for _________________ Markup Language

It provides _________________ and meaning to content

HTML is about _________________ and semantics, NOT appearance!

Elements & Tags

Most HTML elements have:

Void Elements (self-closing) - List 3 examples:

  1. _________________
  2. _________________
  3. _________________

HTML Boilerplate Structure

<!_________ html> <html _________="en"> <head> <meta _________="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <_________>Page Title</_________> </head> <_________> <!-- Content goes here --> </_________> </html>
💡 Quick Tip: Type _____ + Enter in VS Code for instant boilerplate!

Common HTML Elements

Element Purpose
<h1> - <h6> _________________
<p> _________________
<strong> _________________
<em> _________________
<ul> and <ol> _________________
<a href=""> _________________
<img src="" alt=""> _________________

🐙 Git & GitHub

Git vs GitHub

Git GitHub
_________________ control system Web-based _________________
Tracks changes _________________ _________________ repositories
Command-line tool Collaboration platform

Essential Git Commands

Complete the commands and their purposes:

Git Workflow

Number these in the correct order (1-4):

Writing Good Commit Messages

Good commit messages should:

  1. Use _________________ mood (e.g., "Add" not "Added")
  2. Be _________________ characters or less for the subject
  3. Explain _________________ and _________________, not how
Practice: Write a good commit message for adding a navigation menu:

_________________________________________

💻 Command Line Interface (CLI)

Why Use the Terminal?

Essential CLI Commands

Command Function
pwd _________________________
ls _________________________
cd folder _________________________
cd .. _________________________
mkdir name _________________________
touch file.txt _________________________
rm file _________________________

🎨 CSS Foundations

CSS Syntax

_________ { _________: _________; }

Three Ways to Add CSS

  1. Inline: _________________________ (avoid!)
  2. Internal: _________________________ tags in head
  3. External: _________________________ ✅ (BEST!)

CSS Selectors

Complete the selector syntax:

The Cascade - Three Main Factors

  1. _________________ - How specific is the selector?
  2. _________________ - Direct styles beat inherited
  3. _________________ - Last rule wins (tie-breaker)

Specificity Values

Fill in the specificity values:

Calculate Specificity: #header .nav li a

IDs: ___ × 100 = ___
Classes: ___ × 10 = ___
Types: ___ × 1 = ___
Total: ___

📦 The Box Model

Box Model Layers (Inside to Outside)

  1. _________________ - The actual content
  2. _________________ - Space inside the border
  3. _________________ - The edge of the element
  4. _________________ - Space outside the border

Box-Sizing Property

Always use: * { box-sizing: _________________; }

This makes padding and border _________________ in the element's total width

Margin vs Padding

Centering Elements

To center a block element horizontally, use: margin: _________;

Remember: Margins _________________ vertically, padding doesn't!

⚡ Flexbox

Creating a Flex Container

.container { display: _________; }

Flexbox Container Properties

Property Purpose Common Values
flex-direction Sets main axis direction _________ | column
justify-content _________ axis alignment center | space-between | _________
align-items _________ axis alignment center | flex-start | _________

Flexbox Item Properties

Shorthand: flex: 1; means grow: ___, shrink: ___, basis: ___

Common Flexbox Pattern - Center Everything

.center { display: flex; justify-content: _________; align-items: _________; }

📖 Study Tips & Common Mistakes

Study Checklist

Common Mistakes to Avoid

❌ Don't Do This ✅ Do This Instead
Forgetting closing tags _________________________
Using spaces in file names _________________________
Not committing frequently _________________________
Using inline styles _________________________
Ignoring semantic HTML _________________________

🤔 Practice Questions

Answer these to test your understanding:

  1. What's the difference between a class and an ID selector?
    _________________________________________
    _________________________________________
  2. How do you center an element horizontally with margin?
    _________________________________________
  3. What does git add . do?
    _________________________________________
  4. What's the difference between padding and margin?
    _________________________________________
    _________________________________________
  5. How do you make a flex container?
    _________________________________________
  6. What's a void element? Give three examples.
    _________________________________________
    Examples: _________, _________, _________
  7. How does CSS specificity work?
    _________________________________________
    _________________________________________
  8. What command creates a new directory?
    _________________________________________

📝 Additional Notes

Use this space for any additional notes during the review: