Headers
You can create a header using the <header>
tag.
Headers will not have a background color. They will enlarge text wrapped
inside them. Headers are recommended for home and landing pages.
<header>
<h1>
Hi!
</h1>
<h2>
I'm a header!
</h2>
</header>
FUN FACT
Declass's headers have a 5 pixel thick bottom border.
# <hgroup>
To get rid of extra padding, you can wrap the text inside of the header
in an <hgroup>
tag.
<header>
<hgroup>
<h1>
Hi!
</h1>
<h2>
I'm a header without a ton of padding.
</h2>
</hgroup>
</header>
# <center>
Wrapping the content of the header inside of a
<center>
tag will center it.
<header>
<center>
<h1>
Hi!
</h1>
<h2>
I'm a centered header.
</h2>
</center>
</header>
Support | Chrome | Safari | Firefox | Edge | Opera |
---|---|---|---|---|---|
Headers | 5+ | 5+ | 4+ | 12+ | 11.5+ |
<hgroup> |
5+ | 5+ | 4+ | 12+ | 11.5+ |
<center> |
All | All | All | All | All |
Information for this support table comes from Can I Use.