📌 Lecture 2: HTML Basics


What is HTML?



⚙️ Setup

  1. Install VS Code → Download VS Code
  2. Extensions
    • Live Server → Auto-refresh preview.
    • Prettier → Auto-format code.


📖 Common HTML Tags

  1. 1. Headings <h1>–<h6>
    • <h1> → Main title (use once per page).
    • <h2> → Section heading.
    • <h3> → Sub-section.
    • Down to <h6> → least important.
    • Purpose: Creates hierarchy & improves SEO.
  2. Paragraph <p>
    • Groups sentences into blocks
    • Browsers add spacing before/after automatically.
    • Use multiple <p>, not multiple <br>.
  3. Horizontal Rule <hr>
    • Defines a thematic break.
    • Often displayed as a horizontal line.
  4. Line Break <br>
    • Creates a single line break (like pressing Enter once).
    • Use in addresses, poems, etc.
  5. Lists
    • <ul> → Unordered list (bullets).
    • <ol> → Ordered list (numbers).
    • <li> → List items inside <ul> or <ol>.
    • Supports nesting (list inside list).
  6. Anchor <a>
    • Creates hyperlinks.
    • Attribute:
      • href → destination link.
      • target="_blank" → opens in new tab
    • Makes text/image clickable.
  7. Image <img>
  8. Self-closing tag
  9. Attributes:
    • src → image path.
    • alt → description (accessibility).
    • height/width → size.