Summary
In the third lesson, we learned that:
- Attributes are written in the form of
name="value"
. - Hypertext links are created using the
a
element with thehref
attribute, whose value is the link we want to open. - Hypertext links can open a link in a new window by adding the
target
attribute with the value_blank
. - Links can be either absolute, e.g.
https://www.wikipedia.org/
, or relative, e.g../pes.html
. - Relative links can start with
./
, which looks for the file in the same folder as the referencing HTML document. - Relative links can also start with
/
, which looks for the file in the project's root folder. - Images are added using the
img
tag with thesrc
andalt
attributes, where the value ofsrc
is the image link and the value ofalt
is the description for screen readers. - Videos are added using the
video
tag with thesrc
attribute and optionally thecontrols
attribute. The value ofsrc
is the video link, and thecontrols
attribute has no value as it simply enables the control buttons. - Any element can be placed inside a hypertext link to make it a link.
- A hypertext link can link to a specific section of a page by starting the value of the
href
attribute with the symbol#
followed by the value of theid
attribute of the element we want to scroll to.
In this lesson, we learned how to create not only media content like images and videos, but also how to use links and what attributes are. In the next lesson, we will learn how to create tables in HTML and all the associated details.
Instructions
Congratulations on completing the third lesson! The editor contains your final code from this lesson. Now you can customize the page with your newly acquired knowledge.
Start programming for free
10/10