HTML TUTORIALS-
HTML Attribute Reference Learntosap -
Introduction-
HTML Attribute Reference Learntosap -
-What IS HTML Attribute Reference -Attributes provide extra information about HTML elements.They are always included in the opening tag and usually come in name="value" pairs...also Attributes provide additional details
about an element.They help define the behavior, appearance, or data of HTML elements...Example:-
<strong><a href="https://learntosap.com">Visit Learntosap</a></strong>
-)π Common HTML Attributes with Examples:- href
<a href="https://learntosap.com">Visit Learntosap</a>
πΉ-href is the attribute name.
πΉ-"https://example.com" is the value.
πΉ-Together, they tell the browser where the link should go.
-)π οΈ General Rules of Attributes-
πΉ-Attributes are always added to the opening tag.
πΉ-Most attributes have a name and a value, separated by an equals sign =.
πΉ-The value is enclosed in quotes (single or double quotes are both are allowed).
πΉ-Some attributes are boolean (e.g., disabled, checked, readonly) and donβt need a value.
-)π Common HTML Attributes with Examples:- title
<a title="https:// Welcome To learntosap.com">Visit Learntosap.com</a>
-)π§© Common HTML Attributes with Examples:- src
πΉ- Used in elements like <img>, <video>, or <iframe>, src sets the source of the file (image, video, page, etc.).
<a src="img.jpg">Visit Learntosap.com</a>
-)π§© Common HTML Attributes with Examples:- target
πΉ- Used in <a> tags, the target attribute defines where to open the linked document
<a href="page.html" target="_blank">Open in New Tab</a>
-)π§© Common HTML Attributes with Examples:- action
πΉ- Used in <a> forms, it tells the browser where to send the form data..
<form action="submit.php" method="post">
-)π§© Common HTML Attributes with Examples:- style
πΉ- Used in Inline styling with CSS is done using the style attribute. It allows you to change colors, size, spacing, etc., directly within the HTML tag..
<h2 style="color:blue; font-size:24px;">Styled Heading</h2>
-)HTML Global Attributes Reference:-
No | Attribute | Purpose |
---|---|---|
1. | <id> | Unique identifier. |
2. | <class> | CSS/JavaScript targeting. |
3. | <style> | Inline styling. |
4. | <title> | Tooltip text. |
5. | <hidden> | Hides the element. |
6. | <accesskey> | Shortcut key. |
7. | <lang> | Defines the language. |
8. | <multiple> | select multiple files. |