HTML (Hypertext Markup Language) attributes provide additional information about HTML elements. They are always included in the opening tag and come in name/value pairs. Here are some common HTML attributes:
1. `class` Attribute:
- Specifies one or more class names for an element.
Example:
<div class="container">
<!-- Content goes here -->
</div>
2. `id` Attribute:
- Specifies a unique identifier for an element.
Example:
<p id="uniqueParagraph">This is a unique paragraph.</p>
3. `style` Attribute:
- Specifies inline CSS styles for an element.
Example:
<p style="color: red; font-size: 16px;">Styled paragraph text.</p>
4. `src` Attribute:
- Specifies the source URL for external resources, such as images or scripts.
Example:
<img src="image.jpg" alt="An example image">
5. `href` Attribute:
- Specifies the URL for hyperlinks.
Example:
<a href="https://www.example.com">Visit Example Website</a>
6. `alt` Attribute:
- Provides alternative text for images, which is displayed if the image cannot be loaded.
Example:
<img src="image.jpg" alt="Alternative text for the image">
7. `width` and `height` Attributes:
- Define the width and height of certain elements.
Example:
<img src="image.jpg" alt="Image" width="300" height="200">
8. `disabled` Attribute:
- Disables user interaction for certain form elements or buttons.
Example:
<input type="text" disabled>
9. `placeholder` Attribute:
- Provides a short hint that describes the expected value of an input field.
Example:
<input type="text" placeholder="Enter your name">
10. `target` Attribute:
- Specifies where to open a linked document when clicked.
Example:
<a href="https://www.example.com" target="_blank">Open in a new tab</a>
These are just a few examples, and there are many more HTML attributes available. Each HTML element may have specific attributes associated with its functionality and behavior. The choice of attributes depends on the type of element and the desired outcome.