Empty elements - HTML, CSS, WEBSITE DEVELOPMENT AND DESIGN (2015)

HTML, CSS, WEBSITE DEVELOPMENT AND DESIGN (2015)

Chapter 4: Empty elements

HTML elements that have no content are called empty elements. An example of an empty element is the line break <br>. It doesn't have a closing tag and can be written in a few ways. <br> or <br/> or </br>. In the second and third examples we are opening and closing it in the same tag. There are other empty elements and we will go over them but for now below is an example of using the line break:

<p>John Doe<br/>123 Lucky Street<br/>Las Vegas, NV. 77777</p>. It would appear like this on your page:

John Doe

123 Lucky Street

Las Vegas, NV. 77777

Without these line break tags the text would appear all on one line. You can also add multiple line breaks in order to create more separation between a heading and a subheading for example. Adding <br/><br/><br/> would create three empty lines as if you hit the return key on your keyboard three times.

This small chapter is just to explain to you what an empty element is so that when we use them later on you'll have a better understanding of how they work.

Quiz Chapter 4

1.What is an empty element?

2.What is a good example of the use of a line break element from this chapter?