HTML Basics: Inserting the Main Heading into the Page – This is How it Works. Practical Tips

Deutsch

Create the Main Heading of the Page by Using the H1 Tag

Headings are Block Elements. As a result, there is no need to use a line break with <br> before and after the heading.

The H1 tag is used to indicate the primary topic of the web page. Each and every web page needs to have exactly one 1st level heading as its main heading.

The H1 heading starts with <h1> and has to be closed with </h1>.

Example

The main heading of the page is created with the HTML <h1> tag.

<h1>This is the main heading</h1>
Output of the HTML code

This is the main heading

Advertisment

Headings are displayed in bold by default. Please do not use them to make text larger. The main heading of a web page is also known as the page title and is comparable to the headline in a newspaper. The standard font size is 2em. The font size can be set individually using the CSS property font-size.

Note

Headings should be short and concise. They may also be longer than a single line. Note that on a small viewport (e.g. on smartphones), the heading requires more lines. Do not use any other heading (H2 to H6) as a page title, because the font size of the semantically correct heading (H1) is not visually appropriate.