Links and images in HTML

The a element and its addresses (absolute, relative, anchor, mailto, tel), the img element and its alternative text, the figure/figcaption caption and the choice of image format.

  • 24 cards
  • 4 topics
  • Free

The outline, topic by topic

Each topic is weighted the way the exam weighs it.

  1. Concepts
  2. Questions
  3. Sort and link
  4. The numbers

A few cards from the deck

  • Hyperlink: what is it?

    Show the answer

    An a element whose href attribute gives the destination address; a click on its content goes there.

    Without href, an a is no longer a link: it leads nowhere and the Tab key no longer stops on it. The link text must make sense on its own, not "click here".

  • From blog/2024/article.html, which file does href="../index.html" open?

    • blog/index.html
    • index.html à la racine du site
    • blog/2024/index.html
    • 2024/index.html
    Show the answer

    blog/index.html

    The path starts from the folder of the current file, blog/2024/. .. goes up one level, to blog/, then index.html is opened. To reach the root you would need two (../../index.html) or a leading /.

  • An address starting with https:// is an … URL; one that only gives a path from the current file is a … URL.

    Show the answer

    An address starting with https:// is an absolute URL; one that only gives a path from the current file is a relative URL.

    Use an absolute URL to point to another site, a relative one to point to a file in the same site.

  • Relative URL: what is it?

    Show the answer

    An address that only gives the path to follow from the location of the current file, such as images/logo.png or ../index.html.

    It stays valid when the site changes domain. .. goes up one folder, and a path starting with / begins at the root of the site.