Text
In this section we will teach you how to use the two main types of text with Declass:
- Headings
- Paragraphs
# Headings
There are 6 sizes of headings. Use <h1>
for size 6,
<h2>
for size 5, all the way down to
<h6>
for size 1.
FUN FACT
<h6>
is smaller than regular text on large devices
and <h5>
is the same size as text.
<body>
<h1>
I'm a size 6 heading
</h1>
<h2>
I'm a size 5 heading
</h2>
...
</body>
# Paragraphs
Everything that isn't a direct child of another element should be
wrapped in <p>
tags, which create paragraphs. Why?
Paragraphs are mobile-friendly, have a large margin, and are larger than
regular text.
<div>
<h3>
I don't have to be wrapped in a paragraph.
</h3>
</div>
<p>
I do.
</p>
# Centered Text
Text can be centered by wrapping it inside of a
<center>
tag. You can see an example below:
<center>
<h1>
Centered Text
</h1>
<p>
This text is centered
</p>
</center>
Support | Chrome | Safari | Firefox | Edge | Opera |
---|---|---|---|---|---|
<h1> -<h6> |
All | All | All | All | All |
<p> |
All | All | All | All | All |
<center> |
All | All | All | All | All |
Information for this support table comes from Can I Use.