HTML Elements

HTML Elements

An HTML Element is a component of an HTML document that tells a web browser how to structure and interpret a part of the HTML document. HTML elements can contain formatting instructions, semantic meaning, and content.

For example, HTML Elements are used to denote document parts such as headers, paragraphs and footers and to embed content such as hyperlinks, text and images. HTML can be used to provide formatting instructions.

The Basic elements of an HTML are

The <html> element is the root element and it defines the whole HTML document. It has start tag <html> and an end tag </html>

Then inside the <html> element there is an <body> element.

<body>

<h1>My First Heading</h1>
<p>My first paragraph.</p>

</body>

A text header denoted sing the <h1> , <h2> , <h3> , <h4> , <h5> , <h6> tags.

A paragraph denoted using the <p>,

<h1>My First Heading</h1>
<p>My first paragraph.</p>
  • A Horizontal ruler denoted using the <hr> tag.

  • A link is denoted using the <a> tag. (Anchor Tag).

  • A list denoted using the <ul> (unordered list) <ol> (ordered list), and <li> list element tags.

  • An image, demoted using the <img> tag

  • A divider denoted using the <div> tag

ElementDescription
<area>The <area> HTML element defines an area inside an image map that has predefined clickable areas. An image map allows geometric areas on an image to be associated with Hyperlink.
<audio>The <audio> HTML element is used to embed sound content in documents. It may contain one or more audio sources, represented using the src attribute or the source element: the browser will choose the most suitable one. It can also be the destination for streamed media, using a MediaStream.
<img>The <img> HTML element embeds an image into the document.
<map>The <map> HTML element is used with area elements to define an image map (a clickable link area).
<track>The <track> HTML element is used as a child of the media elements, audio and video. It lets you specify timed text tracks (or time-based data), for example to automatically handle subtitles. The tracks are formatted in WebVTT format (.vtt files) — Web Video Text Tracks.
<video>The <video> HTML element embeds a media player which supports video playback into the document. You can use <video> for audio content as well, but the audio element may provide a more appropriate user experience.

The elements here are used to create and handle tabular data.

ElementDescription
<caption>The <caption> HTML element specifies the caption (or title) of a table.
<col>The <col> HTML element defines a column within a table and is used for defining common semantics on all common cells. It is generally found within a colgroup element.
<colgroup>The <colgroup> HTML element defines a group of columns within a table.
<table>The <table> HTML element represents tabular data — that is, information presented in a two-dimensional table comprised of rows and columns of cells containing data.
<tbody>The <tbody> HTML element encapsulates a set of table rows (tr elements), indicating that they comprise the body of the table (table).
<td>The <td> HTML element defines a cell of a table that contains data. It participates in the table model.
<tfoot>The <tfoot> HTML element defines a set of rows summarizing the columns of the table.
<th>The <th> HTML element defines a cell as header of a group of table cells. The exact nature of this group is defined by the scope and headers attributes.
<thead>The <thead> HTML element defines a set of rows defining the head of the columns of the table.
<tr>The <tr> HTML element defines a row of cells in a table. The row's cells can then be established using a mix of td (data cell) and th (header cell) elements.

HTML provides several elements that can be used together to create forms that the user can fill out and submit to the website or application.

ElementDescription
<button>The <button> An HTML element is an interactive element activated by a user with a mouse, keyboard, finger, voice command, or other assistive technology. Once activated, it then acts, such as submitting a form or opening a dialog.
<datalist>The <datalist> HTML element contains a set of option elements that represent the permissible or recommended options available to choose from within other controls.
<fieldset>The <fieldset> HTML element is used to group several controls as well as labels (label) within a web form.
<form>The <form> HTML element represents a document section containing interactive controls for submitting information.
<input>The <input> HTML element 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 and control widgets are available, depending on the device and user agent. The <input> element is one of the most powerful and complex in all of HTML due to the sheer number of combinations of input types and attributes.
<label>The <label> HTML element represents a caption for an item in a user interface.
<legend>The <legend> HTML element represents a caption for the content of its parent fieldset.
<meter>The <meter> HTML element represents either a scalar value within a known range or a fractional value.
<optgroup>The <optgroup> HTML element creates a grouping of options within a select element.
<option>The <option> HTML element is used to define an item contained in a select, an optgroup, or a datalist element. As such, <option> can represent menu items in popups and other lists of items in an HTML document.
<output>The <output> HTML element is a container element into which a site or app can inject the results of a calculation or the outcome of a user action.
<progress>The <progress> HTML element displays an indicator showing the completion progress of a task, typically displayed as a progress bar.
<select>The <select> HTML element represents a control that provides a menu of options.
<textarea>The <textarea> The HTML element represents a multi-line plain-text editing control, useful when you want to allow users to enter a sizeable amount of free-form text, for example a comment on a review or feedback form.