Types of Hyperlinks and Images

Links

Links are created with the "anchor" element <a>. The opening and closing tags surround the text that the users will click on to follow a hyperlink. You need to include the href= attribute to configure the hyperlink reference, which identifies and location of the file you are linking to.

Absolute Links

An absolute link indicates the absolute location of a resource on the Web. Use absolute links when you are linking to pages on a different web site. The href value needs to include the http:// protocol and full URL.

Relative Links

When you are linking to other pages within the same site, use a relative link. The href value does not include the protocol or URL. It only contains directions relative from this page to the one you are linking to.

Email Link

The anchor element can also be used to create an e-mail hyperlink. An e-mail link will automatically launch the default mail program configured for the browser. The href value of an e-mail link starts with mailto: followed by the e-mail address.

This is an example of an ✉ e-mail link

Images

UCBA logo

The image element <img> embeds a graphic file in a webpage. The image element is unusual because it is not coded with seperate opening and closing tags. The src attribute specifies the image file and its location. The alt attribute is required and provides a description for search engines and text replacement if the image does not appear.

Capitalization matters once files are on the server. Keep all image file names lowercase so you don't have to remember if they are upper or lowercase in your code.