HTML Headings Tag - Introducing Heading Tag in Webpage


In HTML, headings are used to define the hierarchical structure and importance of the content on a web page. There are six levels of headings available, ranging from `<h1>` (the highest level) to `<h6>` (the lowest level).


Here's an overview of the HTML headings and their usage:


1. `<h1>`: Represents the highest level heading and is typically used for the main title or heading of the page. It should be used once per page.

2. `<h2>` to `<h6>`: Represents lower-level headings with decreasing importance. They can be used to structure the content within sections or subsections of the page.


Here's an example of how to use HTML headings:


```html

<!DOCTYPE html>

<html>

<head>

  <title>HTML Headings Tutorial</title>

</head>

<body>

  <h1>Welcome to My Web Page</h1>

  

  <h2>About Me</h2>

  <p>I am a web developer with a passion for HTML and CSS.</p>

  

  <h2>Skills</h2>

  <h3>HTML</h3>

  <p>I have expertise in writing clean and semantic HTML code.</p>

  

  <h3>CSS</h3>

  <p>I can style web pages using CSS to create beautiful designs.</p>

  

  <h2>Contact</h2>

  <p>You can reach me at example@example.com.</p>

</body>

</html>

```


In this example, the `<h1>` element is used for the main title of the page. `<h2>` is used for section headings like "About Me," "Skills," and "Contact." Lower-level headings such as `<h3>` are used for subsections within the "Skills" section.


It's important to use headings semantically, meaning that the heading levels should accurately represent the structure and hierarchy of the content. This helps improve accessibility and search engine optimization.


Remember that headings should be used to organize and structure the content, and not solely for styling purposes. Use CSS to apply styles to headings for visual presentation.


That's a brief overview of HTML headings. Experiment with different heading levels to structure your web pages effectively. Happy coding!

Post a Comment

Previous Post Next Post