Adding Text

Adding and Formatting Texts

What We'll Be Building!

Each HTML tag has a specific purpose. Some are used for handling images, some for texts, some for making tables, etc. In this section we'll be taking a look at a few tags used specifically for outputting texts to the screen.

Heading Tags

Header tags are used when you'd like something to stand out on a page.

Lets take a look at some headings.

Heading tags are written as:

  • <h1>

  • <h2>

  • <h3>

  • <h4>

  • <h5>

  • <h6>

<h1> defines the most important heading, while<h6> defines the least important heading.

headings.html
<!DOCTYPE html>
<html>
    <body>
    
        <h1>Heading 1</h1>
        <h2>Heading 2</h2>
        <h3>Heading 3</h3>
        <h4>Heading 4</h4>
        <h5>Heading 5</h5>
        <h6>Heading 6</h6>
    
    </body>
</html>

The DOCTYPE tag

Paragraph Tag

A paragraph tag is used to hold any amount of text you'd like.

Heading tags are written as :

  • <p>

paragraph.html
<!DOCTYPE html>
<html>
    <body>
    
        <p>This is a paragraph.</p>
        <p>This is a paragraph.</p>
        <p>This is a paragraph.</p>
    
    </body>
</html>

Exercises

Create a new html document named texts.html. With this document and using the code above as a guide:

  1. Create a paragraph tag and write:

    "Hello there my name is <insert your here> " in it.

Last updated

Was this helpful?