Comprehensive guide to HTML tags, their types, attributes, and examples
The root element of an HTML document. All other HTML elements are contained within this element.
| Attribute | Description | Values |
|---|---|---|
| lang | Specifies the language of the document | Language code (e.g., "en", "fr", "es") |
define meta tags and title
| Attribute | Description | Values |
|---|---|---|
| meta | use for SEO | keyword,description |
| title | set page title | description of page |
Use to display HTML elements.
| Attribute | Description | Values |
|---|---|---|
| bgcolor | change body color | red,green |
A generic container for flow content. It has no effect on the content or layout until styled with CSS.
| Attribute | Description |
|---|---|
| id | Specifies a unique id for an element |
| class | Specifies one or more class names for an element |
| style | Specifies an inline CSS style for an element |
This is inside a div container
HTML headings. <h1> defines the most important heading, and <h6> defines the least important heading.
Defines a paragraph of text.
This is a paragraph of text. It can contain bold text, italic text, and other inline elements.
Defines a hyperlink, which is used to link from one page to another.
| Attribute | Description |
|---|---|
| href | Specifies the URL of the page the link goes to |
| target | Specifies where to open the linked document (_blank, _self, _parent, _top) |
| rel | Specifies the relationship between the current document and the linked document |
Embeds an image into the document. This is a self-closing tag.
| Attribute | Description |
|---|---|
| src | Specifies the path to the image |
| alt | Specifies an alternate text for the image |
| width | Specifies the width of the image |
| height | Specifies the height of the image |
Embeds a media player which supports video playback into the document.
| Attribute | Description |
|---|---|
| src | Specifies the source URL of the video |
| controls | Shows video controls (play, pause, etc.) |
| width | Sets the width of the video player |
| height | Sets the height of the video player |
| autoplay | Video plays automatically when ready |
| loop | Video restarts when finished |
Defines an unordered (bulleted) list.Type (square, circle, disk)
Defines an ordered (numbered) list.
| Attribute | Description |
|---|---|
| type | Specifies the kind of marker to use (1, A, a, I, i) |
| start | Specifies the start value of the first list item |
| reversed | Specifies that the list order should be descending |
Defines an HTML table for organizing data.
| Name | Age |
|---|---|
| John | 25 |
Defines an HTML form for user input.
| Attribute | Description |
|---|---|
| action | Specifies where to send the form-data when form is submitted |
| method | Specifies the HTTP method to use (GET or POST) |
| target | Specifies where to display the response after submitting the form |
Defines an input control for user input. This is a self-closing tag.
| Attribute | Description |
|---|---|
| type | Specifies the type of input (text, password, submit, radio, checkbox, etc.) |
| name | Specifies the name of an input element |
| value | Specifies the value of an input element |
| placeholder | Specifies a short hint that describes the expected value |
Represents introductory content, typically a group of introductory or navigational aids.
Represents a footer for its nearest sectioning content or root element.
Creates a disclosure widget in which information is visible only when the widget is toggled into an "open" state.
This is the hidden content that appears when you click the summary.
Represents a dialog box or other interactive component.