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.
- Concepts
- Questions
- Sort and link
- The numbers
A few cards from the deck
Hyperlink: what is it?
Show the answer
An
aelement whosehrefattribute gives the destination address; a click on its content goes there.Without
href, anais 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 doeshref="../index.html"open?blog/index.htmlindex.htmlà la racine du siteblog/2024/index.html2024/index.html
Show the answer
blog/index.htmlThe path starts from the folder of the current file,
blog/2024/...goes up one level, toblog/, thenindex.htmlis 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.pngor../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.