From the course: HTML Essential Training
Unlock this course with a free trial
Join today to access over 26,300 courses taught by industry experts.
Embedding images
From the course: HTML Essential Training
Embedding images
- So far, we've gone over different ways to format text-based content, but images can also be used as content. For example, shopping sites use them to showcase products, while personal websites might feature a profile picture or thumbnails for your projects. Images can also be used as design elements to add visual interests, such as a banner image at the top of a page. To add images to an HTML page, use the image tag. It's a void element, so a closing tag is not required. The source attribute must be included to point to the location of the image file. A relative URL points to the files within your project directory. An absolute URL points to an external resource. The syntax for relative and absolute URLs work the same whether you're creating hyperlinks or embedding web resources. When building a website, sometimes you don't have all the content you need right away. Like text generators, many online placeholder image services, like Lorem Picsum, provide temporary images that you can…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.