HTML+Attributes+for+Various+HTML+Elements 1
HTML+Attributes+for+Various+HTML+Elements 1
Here are some commonly used HTML attributes for various HTML elements:
2. class: Specifies one or more class names for an element (used for styling with CSS).
4. src: Specifies the source URL for an external resource, such as an image or script.
6. alt: Specifies alternative text for an image, displayed when the image cannot be loaded.
7. width and height: Specifies the width and height of an element, such as an image or table
cell.
8. disabled: Specifies that an element should be disabled (e.g., a disabled button or input field).
10. required: Specifies that an input field must be filled out before submitting a form.
12. readonly: Specifies that an input field is read-only and cannot be edited.
14. colspan and rowspan: Specifies the number of columns or rows a table cell should span.
15. title: Specifies additional information about an element (often displayed as a tooltip).
16. target: Specifies where to open a linked document (e.g., in a new window or tab).
These are just a few examples, and there are many more attributes available for different HTML
elements. The specific attributes you use will depend on the element and its intended purpose.