JavaScript Tutorial

HTML – Attributes

Attributes provide additional information about an HTML element and are defined within the start tag of the element. Multiple attributes can be added to one element, and they are defined using a name-value pair.

Some basic attributes which are used with elements:

1. Title Attribute

This attribute helps define extra information about content, such as a tooltip. We can use this attribute with any tag.

2. Href Attribute

This attribute defines the link where the page goes on click of an anchor tag. We can also control the opening of the link in the same tab or a new tab using the target attribute.

3. Src Attribute

This attribute defines the path of an image, helping to embed it with the browser.

4. Width and Height Attribute

These attributes help define the width and height of an image tag. These values are defined in pixels.

5. Style Attribute

This attribute helps add style to an element, such as color, font, background color, and more. We can add this style attribute to any element.

Test your HTML skills.

EXERCISE - 1

Make a link that goes to "https://www.lecturely.com/"

<a href="https://www.lecturely.com/">Link</a>

<a href="https://www.lecturely.com/">Link</a>

HTML Quiz Test
Go back to Previous Course