HTML Common Elements List

Document Structure

  1. <html>: Represents the root element of an HTML document.
  2. <head>: Contains metadata about the document.
  3. <title>: Sets the title of the webpage, displayed in the browser's title bar or tab.
  4. <meta>: Provides metadata information about the document, such as character encoding and authorship.
  5. <link>: Links to external resources like stylesheets and icons.
  6. <style>: Contains internal CSS styles for the document.
  7. <script>: Embeds or links to JavaScript code.
  8. <base>: Specifies the base URL for relative URLs within the document.

Content Structure:

  1. <body>: Contains the main content of the webpage.
  2. <h1> to <h6>: Headings, with <h1> being the highest level and <h6> the lowest.
  3. <p>: Defines a paragraph.
  4. <br>: Creates a line break.
  5. <hr>: Represents a thematic break or horizontal rule.
  6. <div>: A generic container for grouping content.
  7. <span>: Inline container for styling or scripting purposes.
  8. <blockquote>: Indicates a block of quoted text.
  9. <pre>: Renders preformatted text.
  10. <code>: Represents a snippet of code within text.
  11. <em>: Emphasizes text (usually italic).
  12. <strong>: Indicates strong importance (usually bold).
  13. <mark>: Highlights text with a specific meaning or context.
  14. <small>: Makes text appear smaller.
  15. <sub>: Specifies subscript text.
  16. <sup>: Specifies superscript text.

Lists

  1. <ul>: Defines an unordered (bulleted) list.
  2. <ol>: Defines an ordered (numbered) list.
  3. <li>: Represents a list item within <ul> or <ol>.
  4. <dl>: Defines a description list.
  5. <dt>: Specifies a term in a description list.
  6. <dd>: Provides the description for a term in a description list.

Links and Anchors

  1. <a>: Creates hyperlinks.
  2. <link>: Defines a hyperlink relation.

Images and Media

  1. <img>: Embeds images.
  2. <audio>: Embeds audio content.
  3. <video>: Embeds video content.
  4. <figure>: Contains media elements and captions.
  5. <figcaption>: Provides a caption for a <figure>.

Tables

  1. <table>: Defines a table.
  2. <thead>, <tbody>, <tfoot>: Groups table header, body, and footer content.
  3. <tr>: Represents a table row.
  4. <th>: Defines a table header cell.
  5. <td>: Specifies a table data cell.
  6. <colgroup>: Groups columns in a table.
  7. <col>: Specifies column properties.

Forms

  1. <form>: Contains form elements.
  2. <input>: Represents various input types (text, password, radio, checkbox, etc.).
  3. <button>: Defines a clickable button.
  4. <textarea>: Specifies a multi-line text input area.
  5. <fieldset>: Groups related form controls.
  6. <legend>: Provides a caption for a <fieldset>.
  7. <optgroup>: Groups related <option> elements within a <select>.

Semantic Elements

  1. <article>: Represents a self-contained composition.
  2. <section>: Defines a thematic grouping within a document.
  3. <header>: Contains introductory content or a set of navigational links.
  4. <footer>: Represents the footer of a document or a section.
  5. <aside>: Contains content that is tangentially related to the content around it.
  6. <main>: Specifies the main content of the document.
  7. <nav>: Marks a section with navigation links.
  8. <time>: Represents a specific time or date.

HTML Attributes

Every HTML element can have attributes. Attributes give extra information about elements. They are always mentioned in the starting tag and typically come in pairs, like: name="value".

Let's see some examples

  1. class: Specifies one or more class names for an element (used with CSS).
  2. id: Specifies a unique ID for an element.
  3. src: Specifies the source URL of a resource, such as an image or script.
  4. alt: Provides alternative text for an image, to be displayed if the image cannot be loaded.
  5. href: Specifies the URL of a linked resource, such as a hyperlink or stylesheet.
  6. style: Allows inline CSS styles to be applied to an element.
  7. width: Sets the width of an element, often used with images or tables.
  8. placeholder: Specifies a short hint that describes the expected value of an input field.

If you want to look at the more info about these html elements you can visit the below link.

1. MDN web docs 2. Geek for Geeks
<h1 id="main-heading" class="highlight">Welcome to my Website!</h1>
<p>This is a simple example demonstrating the use of HTML attributes.</p>
<img src="example-image.jpg" alt="An example image" width="300" height="200">
<a href="https://www.example.com" target="_blank" style="text-decoration: none;">Visit Example Website</a>
<input type="text" placeholder="Enter your name" disabled>