DEV Community

CODE ~ X
CODE ~ X

Posted on

Basic HTML Tags by @bhushcodes

Basic HTML Tags:

  • <html></html>:

Defines the root element of an HTML page. It wraps the entire content of the page.

  • <head></head>:

Contains meta-information about the document, such as the title, links to stylesheets or scripts, meta tags, etc.

  • <body></body>:

Encloses the visible content of the webpage, including text, images, links, headings, paragraphs, etc.

  • <title></title>:

Specifies the title of the webpage that appears in the browser's title bar or tab.

  • <h1></h1> to <h6></h6> (Heading Tags):

<h1> to <h6> are used for headings, where <h1>
represents the highest level of heading and <h6> the lowest level.

  • <p></p> (Paragraph Tag):

Defines a paragraph. Text enclosed within <p> tags is displayed as a separate paragraph.

  • <a></a> (Anchor Tag):

Creates hyperlinks to other web pages or resources. The href attribute specifies the destination of the link.

  • <img> (Image Tag):

Embeds an image into the webpage. It requires the src attribute to specify the image file's URL and may contain an alt attribute for accessibility.

  • <ul></ul> (Unordered List Tag):

Defines an unordered list, which is a list of items without any particular order. Uses <li> (List Item) tags to define each item.

  • <ol></ol> (Ordered List Tag):

Defines an ordered list, which is a list of items in a specific order (usually numbered). Also uses <li> tags for list items.

<!--@bhushcodes-->

<!DOCTYPE html>
<html>
<head>
  <title>Basic HTML Tags</title>
</head>
<body>
  <h1>Main Heading</h1>
  <p>This is a paragraph of text.</p>
  <a href="https://www.x.com/bhushcodes">Link to Twitter</a>
  <img src="image.jpg" alt="Description of Image">

  <h2>Subheading</h2>
  <ul>
    <li>Item 1</li>
    <li>Item 2</li>
    <li>Item 3</li>
  </ul>

  <h3>Another Subheading</h3>
  <ol>
    <li>First item</li>
    <li>Second item</li>
    <li>Third item</li>
  </ol>
</body>
</html>
Enter fullscreen mode Exit fullscreen mode

This example demonstrates the use of several basic HTML tags to structure content, create headings, paragraphs, links, images, and lists. Understanding and utilizing these tags effectively forms the foundation of creating simple yet structured web pages.

Follow for more 😊 👉🏼 @bhushcodes

Top comments (0)