HTML <h2> Tag

If this site has been useful, we’d love your support! Running this site takes time and resources, and every small contribution helps us keep creating valuable content. Consider buying us a coffee to keep things going strong!

Description

HTML offers six different-level headings that show the relative importance of the section after the heading. So, the HTML element <h1> represents the most important heading of the first level, and <h6> serves to indicate the heading of the sixth level and is the least significant. By default, the title of the first level is displayed in the largest font in bold, the headings of the next level are smaller in size. Elements <h1> ..., <h6> belong to block elements, they always begin on a new line, and after them other elements are displayed on the next line. In addition, blank space is added before and after the heading.

Properties

Permitted Parents
Any element that accepts flow content.
Content
Inline and text
Start/End Tags
Start tag: required, End tag: required

Example

<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>

Attributes

None

Global Attributes

The <h1> tag also supports the Global Attributes in HTML5

Event Attributes

The <h1> tag also supports the Event Attributes in HTML5

Browser Support

The following table will show you the current browser support for the HTML <h2> tag.

Desktop
Edge Chrome Firefox Opera Safari
1211154
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview
184143.214.4

Last updated by CSSPortal on: 30th September 2023