Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

HTML_Attributes_Reference

This document is a quick reference guide for HTML attributes, detailing their usage and purpose across various elements. It includes attributes like 'id', 'class', 'href', and 'src', along with their specific functions such as styling, linking, and media handling. The guide serves as a concise resource for understanding essential HTML attributes and their applications.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

HTML_Attributes_Reference

This document is a quick reference guide for HTML attributes, detailing their usage and purpose across various elements. It includes attributes like 'id', 'class', 'href', and 'src', along with their specific functions such as styling, linking, and media handling. The guide serves as a concise resource for understanding essential HTML attributes and their applications.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

HTML Attributes - Quick Reference Guide

Attribute Used In Purpose

id All elements Assigns a unique identifier to an element.

class All elements Defines one or more class names for CSS styling.

style All elements Applies inline CSS styles.

title All elements Displays tooltip text on hover.

href <a> Defines the URL of a hyperlink.

target <a> Specifies where to open a linked document.

src <img>, <audio>, <video> Specifies the file path of media resources.

alt <img> Provides alternative text for an image.

width <img>, <video>, <table> Defines the width of an element.

height <img>, <video> Defines the height of an element.

placeholder <input>, <textarea> Shows hint text in an input field.

readonly <input>, <textarea> Prevents editing of an input field.

disabled Form elements Disables user interaction with an element.

checked <input type='checkbox' or 'radio'>


Pre-selects a checkbox or radio button.

required Form inputs Makes a field mandatory.

maxlength <input>, <textarea> Limits the number of characters allowed.

pattern <input> Defines a regular expression pattern for validation.

action <form> Specifies where form data is sent.

method <form> Defines the HTTP method (GET or POST).

enctype <form> Sets encoding type for file uploads.

autoplay <audio>, <video> Starts playback automatically.

loop <audio>, <video> Repeats media playback continuously.

muted <audio>, <video> Mutes audio by default.

controls <audio>, <video> Adds play, pause, and volume controls.


colspan <td> Merges multiple columns in a table.

rowspan <td> Merges multiple rows in a table.

hidden All elements Hides the element from display.

data-* All elements Stores custom data attributes.

You might also like