HTML Attributes
HTML attributes provide additional information about HTML elements. All elements can have attributes, and attributes have to be specified in the start tag with the format attribute=value.
In the above example, the image tag has 3 attributes:
- src: The source attribute contains the URL of the image, which tells the browser where to find it. We can change the displayed image by changing the value of src, but please use a valid URL, or the browser won't be able to find the image.
- width: The width attribute tells us the width of the displayed image.
- height: the height attribute tells us the height of the displayed image.
Let's play around with the above example and see how these attributes affect our image!
The Anchor Element <a>
The HTML <a> element (or anchor element), with its href attribute, creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URL can address. If the href attribute is present, clicking on the <a> tag will bring you to the destination specified by the href. Set up your destination below, and use the 'click me' link to get there.