# HTML Elements

An **HTML Element** a collection of start and end tags with the content inserted between them. HTML elements are building blocks of web pages, representing different types of content such as **headings**, **paragraphs**, **links**, and **images**.

An HTML element can be defined by ‘***&lt;start-tag&gt;some content&lt;/end-tag&gt;****’.*

For Example :

* The `<html>` element is the root element of an HTML page.
    
* The `<head>` element contains meta information about the HTML page.
    
* The `<title>` element specifies a title for the HTML page.
    
* The `<body>` element defines the document's body.
    
* The `<h1>` element defines a large heading.
    
* The `<p>` element defines a paragraph, etc.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1721736153940/f16bb990-085f-4ff7-bf13-5b95b2083182.png align="center")

## HTML Attributes

* All HTML elements can have **attributes.**
    
* Attributes provide **additional information** about elements.
    
* Attributes are always specified in **the start tag.**
    
* Attributes usually come in name/value pairs like: **name=”value”.**
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1721795623749/6c64787e-df2d-4e0e-b1f4-5838edba072e.jpeg align="center")

### Basic HTML Elements

*HTML ELEMENTㅤㅤㅤㅤㅤㅤㅤㅤ ㅤㅤㅤDESCRIPTION*

◼ &lt;html&gt; represents the root (top-level element) of an HTML ㅤㅤ ㅤㅤㅤㅤㅤㅤㅤㅤ document, so it is also referred to as the \*root element.\*ㅤㅤㅤ All other elements must be descendants of this element.

◼ &lt;title&gt; defines the document’s title that is shown in a browser’s ㅤㅤㅤㅤ ㅤㅤㅤ ㅤ title bar. It only contains text.

◼ &lt;head&gt; ㅤㅤ contains machine-readable information (metadata) ㅤㅤㅤㅤ ㅤㅤㅤㅤ ㅤㅤㅤ about the document, like its title, scripts, stylesheets.

◼ &lt;body&gt; represents the content of an HTML document. There ㅤㅤㅤㅤ ㅤㅤㅤ ㅤㅤ can be only one &lt;body&gt; element in a document. This ㅤㅤㅤㅤ ㅤㅤㅤ ㅤㅤ element is a Nested Element this means that elements ㅤㅤㅤㅤ ㅤㅤㅤㅤ can contain other elements.

◼ &lt;style&gt; ㅤㅤㅤ ㅤ contains style information for a document, or part of a ㅤㅤㅤㅤ ㅤㅤㅤㅤ document. It contains CSS, which is applied to the ㅤㅤㅤㅤ ㅤㅤㅤㅤ ㅤㅤ contents of the document.

◼ &lt;link&gt; ㅤㅤㅤㅤ specifies relationships between the current document ㅤㅤㅤㅤ ㅤㅤㅤㅤ & an external resource. This element is most commonly ㅤㅤㅤㅤ ㅤㅤㅤ ㅤ used to link to CSS.

◼ &lt;header&gt; ㅤㅤㅤ ㅤ represents introductory content, It may contain some ㅤㅤㅤㅤ ㅤㅤㅤㅤ heading elements but also a logo, a search form, an ㅤㅤㅤㅤ ㅤㅤㅤㅤ ㅤㅤ author name, and other elements.

◼ &lt;footer&gt; ㅤㅤㅤ ㅤ represents a footer for its nearest ancestor sectioning ㅤㅤㅤㅤㅤㅤㅤㅤ root element. A &lt;footer&gt; typically contains information ㅤㅤㅤㅤㅤㅤㅤ ㅤ about copyright data or links to related documents.

◼ &lt;main&gt;ㅤㅤㅤㅤ represents the dominant content of the ‘body’ of a ㅤㅤㅤㅤㅤㅤㅤㅤㅤ ㅤ document. The main content area consists of content ㅤㅤㅤㅤㅤㅤㅤㅤ that is directly related to its title of document or the main ㅤㅤㅤㅤㅤㅤㅤ functionality of an application.

◼ &lt;nav&gt;ㅤㅤㅤㅤㅤ represents a section of a page whose purpose is to ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ provide navigation links, either within the current ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ document or to other external documents. some ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ examples of navigation sections are menus and indexes.

◼ &lt;h1&gt; to &lt;h6&gt;ㅤㅤㅤㅤㅤ represent six levels of section headings.  
ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ h1 &gt; h2 &gt; h3 &gt; h4 &gt; h5 &gt; h6 (Headings size)

◼ &lt;p&gt;ㅤㅤㅤㅤㅤㅤㅤ ㅤ represents a paragraph. HTML paragraphs can be ㅤㅤㅤㅤㅤㅤㅤㅤ ㅤㅤ any structural grouping of related content, such as ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ images or form fields, etc.

◼ &lt;a&gt;ㅤㅤㅤㅤㅤㅤㅤㅤ ㅤ *anchor* element, with [its href attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element#attr-href), creates ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ a hyperlink to web pages, files, email addresses, to ㅤㅤㅤㅤㅤㅤㅤㅤㅤ ㅤ anything a URL can address.

◼ &lt;br&gt; ㅤㅤㅤㅤㅤㅤㅤㅤㅤ produces a ‘line break’ in text. It is useful where ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ ㅤ the division of lines is significant.

◼ &lt;section&gt;ㅤㅤㅤㅤ are used for specific section or portion of a document.

◼ &lt;div&gt;ㅤㅤㅤㅤㅤㅤㅤ ㅤ is the generic container for flow content. It has no ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ effect on the content or layout until styled in some ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ way using CSS.

◼ &lt;ol&gt;ㅤㅤㅤㅤㅤㅤ ㅤ represents an ordered list of items — typically ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ rendered as a numbered list. *(1,2,3…)*

◼ &lt;ul&gt;ㅤㅤㅤㅤㅤㅤㅤ represents an unordered list of items, typically ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ rendered as a bulleted list. (◾,◾,◾…)

◼ &lt;li&gt;ㅤㅤㅤㅤㅤㅤㅤ ㅤ used to represent an item in a list. It must be ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ contained in a parent element: an ordered list (&lt;ol&gt;), ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ an unordered list (&lt;ul&gt;), or a menu (menu). In ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ menus and unordered lists, list items are usually ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ displayed using bullet points (⚫). In ordered lists, ㅤㅤㅤㅤㅤㅤㅤㅤㅤ they are usually displayed with an ascending counter ㅤㅤㅤㅤㅤㅤㅤㅤㅤ on the left, such as a number or letter.

◼ &lt;img&gt;ㅤㅤㅤㅤㅤㅤ ㅤ element embeds an image into the document.

◼ &lt;var&gt;ㅤㅤㅤㅤㅤㅤㅤ represents the name of a variable in a mathematical ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ expression or a programming context.

◼ &lt;map&gt;ㅤㅤㅤㅤㅤㅤㅤ is used with area element to define an image ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ map (a clickable link area).

◼ &lt;script&gt;ㅤㅤㅤㅤㅤ ㅤ is used to embed executable code or data; this is ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ typically used to embed or refer to JavaScript ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ ㅤ code.

◼&lt;noscript&gt;ㅤㅤㅤㅤㅤ ㅤ defines a section of HTML to be inserted if a ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ script type on the page is unsupported or if ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ ㅤ scripting is currently turned off in the browser.

◼ &lt;table&gt;ㅤㅤㅤㅤㅤㅤ represents tabular data — that is, information ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ presented in a 2-D table comprised of rows and ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ columns of cells containing data.

◼ &lt;col&gt;ㅤㅤㅤㅤㅤㅤㅤ ㅤ defines a column within a table andㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ ㅤ It is generally found within a &lt;colgroup&gt; element.

◼ &lt;td&gt;ㅤㅤㅤㅤㅤㅤㅤㅤㅤ defines a cell of a table that contains data.

◼ &lt;tr&gt;ㅤㅤㅤㅤㅤㅤㅤ defines a row of cells in a table. The row’s cells can ㅤㅤㅤㅤ ㅤㅤㅤㅤㅤ ㅤ then be established using a mix of td & th elements.

◼ &lt;th&gt;ㅤㅤㅤㅤㅤㅤㅤ defines a cell as header of a group of table cells.

◼ &lt;center&gt;ㅤㅤㅤㅤㅤㅤㅤㅤ ㅤ is a block-level element that displays its ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ block-level or inline contents centered ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ ㅤ horizontally within its containing element.

◼ &lt;font&gt;ㅤㅤㅤㅤㅤㅤㅤ defines the font size, color and face for its content.

◼ &lt;frame&gt;ㅤㅤㅤㅤㅤㅤㅤ defines a particular area in which another HTML ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ document can be displayed.

◼ &lt;marquee&gt; ㅤㅤㅤㅤㅤㅤ is used to insert a scrolling area of text. You ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ can control what happens when the text reaches ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ the edges of its content area using its attributes.

◼ &lt;form&gt;ㅤㅤㅤㅤㅤㅤㅤㅤ represents a document section containing ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ ㅤ interactive controls for submitting information.

◼ &lt;input&gt; ㅤㅤㅤㅤㅤㅤㅤ ㅤ is used to create interactive controls for web-ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ based forms in order to accept data from the ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ ㅤ user; a wide variety of types of input data are ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ ㅤavailable.

◼ &lt;label&gt;ㅤㅤㅤㅤㅤㅤㅤ ㅤ represents a caption for an item in a user ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ ㅤ interface.

◼ &lt;option&gt;ㅤㅤㅤㅤㅤㅤㅤ ㅤ is used to define an item contained in a ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ select or a datalist element.

◼ &lt;select&gt;ㅤㅤㅤㅤㅤㅤㅤ ㅤrepresents a control that provides a menu of ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ ㅤ options.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1721975332616/34819719-7400-4c7b-a0d4-1ebc2acaca96.jpeg align="center")
