What is HTML Element ?
HTML (Hypertext Markup Language) elements are the building blocks of web pages. They are the individual components used to structure and present content on the internet. Each element is represented by tags that define its purpose and how it should be displayed or function.
A Basic HTML element look like this :
<tag> content </tag>
"<tag>" represents the opening tag.
"</tag>" represents the closing tag.
"content" means actual content of the tag are written here.
Examples:
<p> This is a space to write some paragraph </p>
<a href = "www.google.com"> click here to open google </a>
in above example <p> is a paragraph opening tag, </p> is paragraph closing tag., Content is written between those two tags.
"<a>" is an anchor tag used to create hyperlink and "href" is an attribute specifying the destination url.
List of some standard elements available in HTML:
<!DOCTYPE html>
: Document type declaration.<html>
: Root element that wraps the entire HTML content.<head>
: Contains meta-information about the HTML document.<title>
: Sets the title of the HTML document.<meta>
: Provides metadata about the HTML document.<link>
: Links external resources like stylesheets.<style>
: Contains CSS for styling the document.<script>
: Embeds scripts, such as JavaScript, within the document.
<body>
: Encloses the visible content of the HTML document.Text content elements:
Headings:
<h1>
to<h6>
<p>
: Defines a paragraph.<span>
: Inline container for text.<br>
: Line break.<hr>
: Horizontal rule.
Structural elements:
<div>
: Generic container to group elements.<header>
,<footer>
,<main>
,<nav>
,<section>
: Semantic structural elements introduced in HTML5.
List elements:
<ul>
: Unordered list.<li>
: List item within an unordered list.
<ol>
: Ordered list.<li>
: List item within an ordered list.
<dl>
: Description list.<dt>
: Description term.<dd>
: Description details.
<table>
: Defines a table.<thead>
,<tbody>
,<tfoot>
: Table sections (header, body, footer).<tr>
: Table row.<th>
: Table header cell.<td>
: Table data cell.
Forms and input elements:
<form>
: Contains form elements.<input>
: Input fields.<textarea>
: Multiline text input.<button>
: Defines a clickable button.<select>
: Dropdown selection list.<option>
: Option within a select list.
Multimedia elements:
<img>
: Embeds an image.<audio>
: Embeds audio content.<video>
: Embeds video content.<iframe>
: Embeds another HTML page.
<a>
: Creates hyperlinks.<blockquote>
: Defines a block of quoted content.<cite>
: Denotes the title of a work cited within text.<code>
: Represents a snippet of code.<abbr>
,<acronym>
,<address>
,<b>
,<em>
,<strong>
,<small>
,<sub>
,<sup>
,<time>
,<cite>
,<kbd>
,<pre>
,<q>
,<mark>
,<del>
,<ins>
,<samp>
,<var>
,<dfn>
,<ruby>
,<rt>
,<rp>
: Various other elements for specific formatting or semantic purposes.
Subscribe to my newsletter
Read articles from MAYANK VIKRAMBHAI PARMAR directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by