HTML Tags, Attributes, and Elements Reference
Component Use Where to Use
<html> Root of HTML document Encloses all other HTML content
<head> Contains meta info, links, title Inside <html>, before <body>
<title> Title shown in browser tab Inside <head>
<meta> Metadata like charset or viewport Inside <head>
<link> Links to external resources like CSS Inside <head>
<style> Embed CSS styles Inside <head> or <body>
<script> Embed or reference JavaScript Inside <head> or <body>
<body> Main content of HTML document Inside <html>
<h1> to <h6> Headings Inside <body>
<p> Paragraph Inside <body>
<a> Anchor, hyperlink Inside <body>
<img> Image Inside <body>
<div> Block container Inside <body>
<span> Inline container Inside <body>
<ul> Unordered list Inside <body>
<ol> Ordered list Inside <body>
<li> List item Inside <ul> or <ol>
<table> Table Inside <body>
<tr> Table row Inside <table>
<td> Table cell Inside <tr>
<th> Table header cell Inside <tr>
<form> Form container Inside <body>
<input> Input field Inside <form>
<textarea> Multi-line text input Inside <form>
<button> Clickable button Inside <form> or <body>
<select> Dropdown menu Inside <form>
<option> Option in dropdown Inside <select>
class Defines CSS class Any HTML element
id Unique identifier Any HTML element
href URL for link <a>, <link>
src Source URL <img>, <script>
alt Alternative text <img>
title Tooltip text Any HTML element
style Inline CSS Any HTML element
type Defines input type <input>, <button>, <script>
value Defines field value <input>, <button>, <option>
name Form field name <input>, <textarea>, <select>
placeholder Hint for input <input>, <textarea>
action Form submission URL <form>
method HTTP method for form <form>