Saturday, June 22, 2024

List of common HTML tags with examples

List of common HTML tags with examples

Hello guys how are you? Welcome back to my blog. Today in this blog post I am going to tell All the Attributes of html page with description and uses.

HTML tags are the building blocks of HTML used to create and structure web pages. Here’s a list of common HTML tags with examples:

1. <html>

Defines the root of an HTML document.


2. <head>

Contains metadata/information for the document.

  <title>Page Title</title>

3. <title>

Defines the title of the document, shown in the browser’s title bar or tab.

<title>My Web Page</title>

4. <meta>

Defines metadata about an HTML document.

<meta charset="UTF-8">

5. <link>

Defines the relationship between a document and an external resource.

<link rel="stylesheet" href="styles.css">

6. <style>

Defines internal CSS styles.

  body { font-family: Arial, sans-serif; }

7. <script>

Defines a client-side script.

  alert('Hello, world!');

8. <body>

Defines the document’s body, containing all the content.

  <h1>Welcome to My Website</h1>

9. <h1> to <h6>

Defines HTML headings.

<h1>This is a heading 1</h1>
<h2>This is a heading 2</h2>

10. <p>

Defines a paragraph.

<p>This is a paragraph of text.</p>

11. <a>

Defines a hyperlink.

<a href="">Visit Example</a>

12. <img>

Embeds an image in the document.

<img src="image.jpg" alt="A beautiful scenery">

13. <ul>

Defines an unordered (bulleted) list.

  <li>Item 1</li>
  <li>Item 2</li>

14. <ol>

Defines an ordered (numbered) list.

  <li>First item</li>
  <li>Second item</li>

15. <li>

Defines a list item.

  <li>List item</li>

16. <div>

Defines a division or section in a document.

<div class="container">
  <p>This is a section.</p>

17. <span>

Defines a section in a document, used for grouping inline elements.

<p>This is a <span style="color: red;">red</span> word.</p>

18. <table>

Defines a table.

    <th>Header 1</th>
    <th>Header 2</th>
    <td>Data 1</td>
    <td>Data 2</td>

19. <tr>

Defines a row in a table.

  <td>Row 1, Cell 1</td>
  <td>Row 1, Cell 2</td>

20. <th>

Defines a header cell in a table.

<th>Table Header</th>

21. <td>

Defines a cell in a table.

<td>Table data</td>

22. <form>

Defines an HTML form for user input.

<form action="/submit_form" method="post">
  <label for="name">Name:</label>
  <input type="text" id="name" name="name">
  <input type="submit" value="Submit">

23. <input>

Defines an input control.

<input type="text" name="username">

24. <label>

Defines a label for an <input> element.

<label for="email">Email:</label>
<input type="email" id="email" name="email">

25. <textarea>

Defines a multi-line text input control.

<textarea name="message" rows="4" cols="50"></textarea>

26. <button>

Defines a clickable button.

<button type="button">Click Me!</button>

27. <select>

Defines a drop-down list.

<select name="cars">
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>

28. <option>

Defines an option in a drop-down list.

<option value="fiat">Fiat</option>

29. <header>

Defines a header for a document or section.

  <h1>Site Title</h1>

30. <footer>

Defines a footer for a document or section.

  <p>&copy; 2024 My Website</p>

31. <nav>

Defines navigation links.

  <a href="/home">Home</a>
  <a href="/about">About</a>
  <a href="/contact">Contact</a>

32. <article>

Defines an independent, self-contained content.

  <h2>Article Title</h2>
  <p>This is an article.</p>

33. <section>

Defines a section in a document.

  <h2>Section Title</h2>
  <p>This is a section.</p>

34. <aside>

Defines content aside from the main content.

  <h2>Related Content</h2>
  <p>This is an aside.</p>

35. <main>

Specifies the main content of a document.

  <h1>Main Content</h1>
  <p>This is the main content of the page.</p>

36. <figure>

Specifies self-contained content, like illustrations, diagrams, photos, code listings, etc.

  <img src="image.jpg" alt="A scenic view">
  <figcaption>A scenic view.</figcaption>

37. <figcaption>

Defines a caption for a <figure> element.

<figcaption>Figure caption goes here.</figcaption>

38. <blockquote>

Defines a section that is quoted from another source.

<blockquote cite="">
  This is a blockquote from an external source.

39. <code>

Defines a piece of computer code.

<code>console.log('Hello, world!');</code>

40. <pre>

Defines preformatted text.

  Text in a pre element
  is displayed in a fixed-width
  font, and it preserves
  both      spaces and
  line breaks.

These tags cover a wide range of functionalities necessary for building a structured and interactive web page.


the authortherichpost
Hello to all. Welcome to Myself Ajay Malhotra and I am freelance full stack developer. I love coding. I know WordPress, Core php, Angularjs, Angular 14, Angular 15, Angular 16, Angular 17, Bootstrap 5, Nodejs, Laravel, Codeigniter, Shopify, Squarespace, jQuery, Google Map Api, Vuejs, Reactjs, Big commerce etc.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.