Module 3: HTML Attributes

What are HTML Attributes?

HTML attributes provide additional information about HTML elements. Attributes are always specified in the opening tag and usually come in name/value pairs like name="value".

Common HTML Attributes

Some common HTML attributes include:

Example of HTML Attributes


<a href="https://example.com">Visit Example Website</a>
<img src="image.jpg" alt="Sample Image" style="width:200px;height:100px;">
            

Try It Yourself

Quiz: Test Your Knowledge

Which attribute is used to specify the URL for a link?

Coding Challenge

Create a link that opens the OpenAI website in a new tab, and add an image with an alt text of your choice below the link.