- This topic is empty.
-
Topic
-
In HTML,
<h1>
is a tag used to define the most important heading on a web page. It is part of the heading elements in HTML which range from<h1>
to<h6>
, with<h1>
being the highest or most important level and<h6>
being the lowest.Syntax
The basic syntax of an
<h1>
tag is as follows:html<h1>This is a heading</h1>
Usage
- Hierarchy: The
<h1>
tag is typically used once per page to represent the main title or topic of the page. This helps in defining the document structure and is important for accessibility and SEO (Search Engine Optimization). - Styling: By default, the text inside an
<h1>
tag is rendered in a larger and bolder font compared to regular text. However, this can be customized using CSS.
Example
Here is an example of a simple HTML document using an
<h1>
tag:html
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Example of H1 Tag</title>
</head>
<body>
<h1>Welcome to My Website</h1>
<p>This is a paragraph of text on my website.</p>
</body>
</html>
“Welcome to My Website” is the main heading of the page.
- Hierarchy: The
- You must be logged in to reply to this topic.