Links, images and lists

Knowledge Videos

Short animated explainers, organised by subject.

Links, images and lists

Attributes add information to a tag: href for links, src and alt for images. How a relative path finds a file, and how ul, ol and li make lists.

Transcript

An attribute gives a tag extra information. It goes inside the opening tag, as a name and a value in quotes.

The a tag makes a link. Its h ref attribute says where the link goes. The text between the tags is what you click.

The i m g tag shows a picture. Its source attribute, s r c, is the path to the image file. The alt attribute describes the picture in words, for people who cannot see it.

A path tells the browser where a file lives, just like the folders in the terminal. Images slash cat dot j p g means: go into the images folder, and find the file cat dot j p g.

Lists are elements too. A u l is a bulleted list, an o l is a numbered list, and each item is an l i.

Remember: an attribute adds information to a tag. H ref is where a link goes, source is where an image is, and a path tells the browser where to find the file.

More in this series