HTML Academy
The h1-h6 and title tags in HTML
HTML document structure12/19
Back to the list of tasks
  • 1. The HTML doctype, or document type declaration
  • 2. Basic HTML tags
  • 3. The head tag, which provides metadata information about the page
  • 4. The title tag for page titles
  • 5. The main tag for main content
  • 6. The header and footer tags
  • 7. The section tag, which is used for semantic sections
  • 8. The nav tag, which is used to specify the main navigation
  • 9. The article tag, which is used to indicate an independent section
  • 10. The aside tag, which is used to specify additional content
  • 11. The h1-h6 and title tags in HTML
  • 12. The p tag for paragraphs
  • 13. Let’s finish marking up our pages
  • 14. The meta tag, which is used for page character encoding
  • 15. The meta tag, which is used for keywords
  • 16. Let’s try a different page layout
  • 17. Summary of “HTML document structure”
  • 18. First challenge
  • 19. First mastery challenge
Let’s finish marking up our pages
  • Sign up
  • Log in

Loading…
Everything will be ready in few seconds

  • Theory
  • Theory
  • Comments

The p tag for paragraphs

You can create the basic structure for the text using headings. The finer structure can be specified using paragraphs. The tag <p> (which stands for “paragraph”) is used to mark up paragraphs.

By default, browsers separate paragraphs from surrounding content with top and bottom margins (which you can change with CSS). So, if you need to separate one block of text from another, the right decision would be to enclose them in <p> tags.

<p>A paragraph about how I decided to become a coder</p>
<p>A paragraph about my instructor</p>
<p>A paragraph about my blog</p>

Let’s now mark up the introductory text on our main webpage using paragraphs.

A paragraph usually groups sentences about a common theme. In HTML, the <p> element represents a paragraph.

HTML also defines paragraphs as runs of phrasing content. Such runs can occur without a <p> element, but using <p> explicitly marks the paragraph and gives it meaning in the document.

The <p> tag lets us explicitly mark paragraphs that group elements with phrasing content. These paragraphs can contain not only text, but also images, links or input fields, for example.

Not all tags can be nested within <p>. For example, major structural tags, headings, forms, lists and tables cannot be placed inside a paragraph. When your browser encounters an inappropriate tag inside <p>, it will automatically close the <p>, then display the inappropriate tag, followed by the remainder of the paragraph but without a surrounding tag, and then it will insert an empty <p> before the </p> that you wrote.

Comments

  • index.html
HTML
<!DOCTYPE html> <html lang="en"> <head> <title>The website of a beginning coder</title> <link rel="stylesheet" href="outlines.css"> </head> <body> <header> <h1>The website of a beginning coder</h1> </header> <main> <nav> Navigation </nav> <section> Greetings to everyone! Welcome to my first site. Up until just recently I had no idea what a coder does for a living, but now I have found interactive courses in HTML and CSS and I have set myself the goal of becoming one. I was even assigned an instructor, Muffin, who won’t let me slack off and will track my progress. My first assignment is to keep a diary and honestly write about all of my accomplishments. </section> <section> Skills section </section> </main> <footer> Website footer </footer> </body> </html>

What didn’t you like in this task?

Thanks! We’ll fix everything at once!

The code has changed, click “Refresh” or turn autorun on.

You’ve gone to a different page

Click inside the mini-browser to shift the focus onto this window.

100%
Goalscompleted
0

    Break the text in the first “section” into two paragraphs.

    1. The first paragraph should consist of the text that starts with the phrase Greetings to everyone! and ends with the words my progress,
    2. The second paragraph should contain the remaining sentence: My first assignment … accomplishments.

    Cookies ∙ Privacy ∙ License Agreement ∙ About ∙ Contacts ∙ © HTML Academy OÜ, 2019−2026

    VISAMastercard

    Log in

    or

    Forgot your password?

    Sign up

    Sign up

    or
    Log in

    Restore access

    Have you forgotten your password or lost access to your profile? Enter your email connected to your profile and we will send you a link to restore access.

    Forgot to connect your email to the profile? Email us and we’ll help.