Skip to main content
Ctrl+K
Logo image
  • Welcome to Introduction to Web Development

Part I - Getting started

  • 1. Software and accounts
    • 1.1. Required software
    • 1.2. Configure VS Code
    • 1.3. Create a Codepen Account
    • 1.4. Create a Github account
    • 1.5. Understand Git and GitHub basics
    • 1.6. Choose an image editor
  • 2. How the internet works
    • 2.1. Introductory videos
    • 2.2. Browser market share charts
    • 2.3. Learn more
  • 3. Style guides
    • 3.1. Color on the web
    • 3.2. Designing for accessibility
    • 3.3. Useful links
    • 3.4. Style guide assignment

Part II - HTML

  • 4. HTML basics
    • 4.1. HTML template
    • 4.2. Configuring HTML <head>
    • 4.3. Validating HTML
    • 4.4. HTML Style Guide
    • 4.5. Useful links
    • 4.6. First web page assignment
  • 5. Semantic HTML
    • 5.2. Semantic HTML assignment
  • 6. Accessibility basics
  • 7. Links and basic images
    • 7.2. Resources for images
  • 8. Responsive images and SVG
    • 8.1. Create a simple SVG learning task
    • 8.2. Responsive images and SVG assignment

Part III - CSS basics

  • 9. CSS basics
    • 9.3. CSS specificity
    • 9.4. Styling links
    • 9.5. CSS positioning
    • 9.6. CSS topic presentation learning task
    • 9.7. Whitespace and font size observations learning task
    • 9.8. Web button learning task
    • 9.9. Web card learning task
    • 9.10. CSS fonts and a button assignment

Part IV - Animation

  • 10. Animation

Part V - CSS layouts

  • 11. CSS layouts
  • 12. Overlays and cards assignment

Appendix

  • 13. Useful links
  • 14. Glossary
  • 15. Index
  • Repository
  • Open issue
  • .md

Links and basic images

Contents

  • 7.1. Learn more

7. Links and basic images#

Objectives

Links

  • Understand what hyperlinks, URLs, and paths are

  • Understand the difference between absolute and relative links, and when to use one or the other

  • Know how to write clear link text and understand how it impacts accessibility and SEO

  • Be able to link to document fragments

  • Understand why an optimal “touch target” is 44 x 44 pixels

Images

  • Demonstrate image loading with the Dev Tool’s waterfall chart, and understand how image size impacts page load speed

  • Know how to determine image size and resolution for web pages

  • Understand lazy loading and its implementation in HTML

  • Be familiar with web graphic formats including JPG, PNG, GIF, and WEBP, and explain when each type is appropriate

  • Know how to find, crop, and resize images, and understand image copyright laws

  • Know when to use alt attribute and how to write appropriate alt text

  • Identify when <figure> and <figcaption> should be used

  • Understand the appropriate use of <img> width and height attributes

Watch this 3 minute Small Thing Big Idea TED video: How the hyperlink changed everything

Read:

  • MDN’s Creating hyperlinks

  • MDS’s Images in HTML

  • CSS Trick’s A Deep Dive into Native Lazy-Loading for Images and Frames - you don’t need to enable lazy loading in browsers any more, it’s baked in

Tip

Relative paths tl;dr

  • src="image.png" – look in the current folder

  • src="../image.png" – look in the parent folder (go “back” or “up” depending on how you visualize the directory structure)

Do not use

  • src="/image.png" – root relative, look in the root folder; on some servers this will look in the same folder as your main index.html, but on GitHub pages, it will not work.

  • src="./image.png" – this is the same as current folder about but is not recommend

Tip

Lazy loading tl;dr

Add loading="lazy" to image tags that are below the fold (not visible when the page loads). This will delay loading the image until the user scrolls to it. This can significantly improve page load speed.

Scan:

  • MDN’s <a> : The Anchor Element – focus on the download and target attributes. Also understand how to link to an email address and a telephone number.

  • CSS Tricks: Looking at WCAG 2.5.5 for Better Target Sizes – this will be more relevant when we learn CSS

7.1. Learn more#

for CSS: Enhancing The Clickable Area Size

previous

6. Accessibility basics

next

7.2. Resources for images

Contents
  • 7.1. Learn more

By Lara Burton

© Copyright 2023.