Links and Layout

We will look at some HTML elements that are used for linking to other webpages and files and also for the layout of your web page.

  • Anchors

  • DIV tags

  • Link

HTML Anchor Tag

The anchor tag <a> is used to create an anchor that can be clicked on for a Hyperlink to take place. It creates the item (anchor) that you will click on for the hyperlink to take place.

It can be either text or images.

Anchor Tags (Text Hyperlinks)

The standard anchor tag will display blue text which can be clicked on to take you to that page.

A standard anchor tag structure

Example anchor tag

Anchor tags (Image Hyperlinks)

This anchor tag uses an entire image tag instead of text.

HTML Div Tag

The division tag <DIV> is a container element that can be used to hold other elements and is primarily used for layout purposes with CSS (more on these here) .

HTML Link Tag

Contrary to what you may think the link tag is not used to create hyperlinks, it is used to link other external files to the web page. Usually CSS files or JavaScript.

The code above will link to an external stylesheet called main.css