Basic HTML
Computing Resources >> Tutorials >> Web Development >> Basic HTML 

What is HTML?

Basic Tags

Links & Images

Additional Resources

Evaluate this Tutorial

 

Text Formatting Tags

Let's take a look at some basic text formatting tags. We'll start with the <p> tag, which is used to make paragraphs. Take a look at the following code example. Note the text that we place inside the <p> tags.

<html>
   <head>
     <title>
       My First HTML Page
     </title>
   </head>
   <body>
    <p>This is paragraph one.</p>
    <p>This is paragraph two.</p>
    <p>And three...and so forth</p>
   </body>
</html>

Honestly, you could use only paragraph tags in your documents and you'd be fine. If all you want to do is display text with minimal formatting, <p> tags will work just fine. What are some others? The <br> tag is one tag that is very useful. This is called the "break" tag. It breaks a line of text and returns it to the next line. This is useful in cases where you want to add some spacing between lines. So take a look at this example.

<html>
   <head>
     <title>
       My First HTML Page
     </title>
   </head>
   <body>
    <p>This is paragraph one.<br>
       This line has been returned to the next line.<br>
       As has this one.<br>
       This is all within one paragraph.
    </p>
   </body>
</html>

Notice that the <br> tag does not need to be closed. This is one of the notable exceptions to the rule that you must close all your HTML tags. The <br> tag is what is called an unary versus a binary tag (i.e. one self-contained tag vs. a binary pair of tags). Another unary tag is the <hr> tag, which is called the horizontal row tag. This tag will place a line across your screen. This can be used stylistically to divide up portions of your web page. Here's a horizontal row tag in action:


Simply place the tag in the place in your code where you want it to appear. So if in our previous example, we wanted to put a horizontal row at the bottom of the page, we would simply append it (i.e. the <hr> tag) to the code after we closed the last <p> tag (or before...it doens't matter so long as it is within the <body> tags).

next section >

Watch the video
screenshot
choose format/speed
real media dial-up | broadband

Tutorial Transcript

© 2004 Chad Hutchens & Libby Peterek | iSchool | UT Austin | webmaster