Overview of Adding Links and Images
A web page usually utilizes other resources besides the HTML file itself. To integrate all the resources, you must instruct web browsers how to connect with those resources. In general, there are three types of links you can add to HTML documents to access the website resources:
- Embed content:
<img>
,<video>
,<iframe>
- Add hyperlinks:
<a>
- Add links for browser instructions:
<link>
,<script>
1. Embed content: <img>, <video>, <iframe>
Most websites utilize media content. To embed media content, you need to use specific tags depending on the type of media content. For example, the <img>
tag for image files, the <video>
tag for video files, and the <iframe>
tag for other website content. In this course, we'll cover the <img>
tag. The <video>
and <iframe>
tags will be covered in the next course HTML & CSS Intermediate.
2. Add hyperlinks: <a>
One of the most important concepts and functionalities of the World Wide Web (WWW) is the hyperlink. <a>
(called anchor tag) is used to add hyperlinks. Using the anchor tag, you can add links to another page on your website, a specific location on the page, or other web pages on the internet.
3. Add links for browser instructions: <link>, <script>
Typically, CSS and Javascript codes are written in different files. Website visitors won't see the files, but you need to give instructions to web browsers to access those files. The <link>
tag is usually used to add links to CSS files and the <script>
tag is used to add links to Javascript files. The <link>
tag can also be used for other purposes such as adding a favicon.