Web Platform HTML

Text

HTML was designed for documents so anything you put in your document which isn't a tag is displayed as text to the user.

Because line breaks in a HTML file are ignored, if you want to break lines, use the <br /> tag:

this is<br />
two lines
this is
two lines

Consecutive spaces is also ignored:

W   i   d     e     .
W i d e .

Paragraphs

If you are writing a logical paragraph, use the P tag . This will wrap the text and add a bit of extra vertical spacing.

A line<br />
break<br />
<p>Paragraph 1</p>
<p>Paragraph 2</p>
A line
break

Paragraph 1

Paragraph 2

Spans of Text

If you want to control a span of text (for example to apply formatting differently), use the SPAN tag. This won't cause a line break.

<p>
  This is a <span style="font-weight: bold">lot</span>.
</p>

This is a lot.

Headings

You can use H1 through to H6 as headings. These are semantically significant. For example a H1 is a top-level heading you might use for a title, while H2 for a sub-title.

<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>

Heading 1

Heading 2

Heading 3

Read more

Reference