Learning HTML (Part 2)

Rob McBryde
2 min readDec 14, 2023

--

Overview

Following on from HTML-Part 1 where we created our page and added a heading. Now let’s work on adding a paragraph of text about yourself.

Single Tag Elements

Open your ‘my_page.html’ code once more in your editor of choice and we will add a horizontal rule below our heading
to visually separate the content.

There are certain HTML elements that only consist of a single tag without content, or a closing tag. The horizontal rule element is one of these. Add the following tag within the body tags, underneath our heading

<hr />

Your HTML should look something like this (the spacing is not mandatory and is ignored by the web browser but its good practice to help keep you code clean and easier to read as it grows in size)

Save the file and open the ‘my_page.html’ file in your web browser.

<html>
<body>
<h1>Rob McBryde</h1>
<hr>
</body>
</html>

Adding A Paragraph

Now add a paragraph about yourself using the in <p> element.

The <p> element marks all the text inside it as a distinct paragraph. Populate yours with a statement introducing yourself (make sure it is placed within your body tags, below the horizontal rule).

<p>I am a Software Coach. I like learning new technologies and understanding how they can be used to make
great products that users like to use.</p>

Save your code and inspect your changes in your Web Browser. Notice that when you resize the width of the window, your horizontal line and paragraph automatically adapt their layout.

--

--

Rob McBryde

Test Engineer who empowers testers through coaching to enable their growth and knowledge of technology and automation.