HTML Attributes:
HTML attributes are special modifier words placed inside an element's opening tag to provide additional information, configuration, or behavioral changes to that element. They essentially customize how a standard HTML element looks, functions, or interacts with the user.
The Structure of an Attribute
Attributes almost always arrive in name/value pairs and follow a strict structural syntax
Attribute Name: Specifies the property you want to set (e.g., href, src, class).
Attribute Value: Specifies the actual setting or instruction, which must be enclosed in quotation marks.
example:
<a href="https://www.wikipedia.org" target="_blank">Visit Wikipedia</a>
Common attributes
** Global vs Element-Specific Attributes**
Global attributes work on any HTML element:
Tag and Key Attributes
1.<a>- href, target, rel
<img>- src, alt, width, height<input>- type, name, placeholder, required<button>- type, disabled, onclick<div>- id, class, style<form>- action, method<table>- border, cellpadding<link>- rel, href, type<script>- src, defer, async


Top comments (0)