Code

Headings and Paragraphs

Headings and paragraphs are the most fundamental text elements in an HTML webpage; the headings introduce sections while the paragraphs provide information. They are also the easiest tags to learn.

Headings

In HTML, headings are used to divide webpages into sections. In order to display a large heading, you use the <h1> tag. However, HTML provides six heading types, from <h1> to <h6>, <h1> being the largest and <h6> being the smallest. Here's an example:

headings-img-1

This code yields the following result:

headings-img-2

Paragraphs

Paragraph tags are similar to headings. Without paragraph tags, the text can still be displayed, but it cannot be separated into different sections. Instead of using the <h1> tag like you would for a header, you would use the <p> tag. So, if you were to print hello world in the same paragraph, the syntax would be the following:

paragraph-img-1

Images created by Ethan Cheng, accessed from Codehs.com.