Lesson 2 Source Code Explanations

The Lesson 2 source code is the Lesson 1 source code without the comment line of code (the first line of code), and with source code added for the New Line Tag. This added code appears immediately after the Lesson 1 paragraph code.

The first line of added code is a heading line (h2 heading) containing the text "New Line Tag" (scroll this code into view in the above frame; scroll through the lesson 1 source code to get to this code). This code causes the text "New Line Tag" to appear on the web page in the heading size of "2". Note the opening and closing h2 tags.

The next line of added code is a paragraph containing the text "List of states" (scroll this code into view in the above frame). This code causes the text "List of states" to appear on the web page in paragraph form. Note the opening and closing paragraph tags.

The next five lines of added code create a paragraph (scroll all five lines into view in the above frame). The "br" (break) tag is the new line tag. The four break tags in this paragraph create five lines on the computer screen (this use of break tags causes the text within the paragraph to appear as a list on the computer screen).

As a matter of style, these five lines of code could be typed as one line of source code, with or without spaces between tags or state names, and this would not change the appearance of these lines on the web page. The style of having the source code appear similar to the appearance of the data on the web page may be helpful during debugging activities (especially during learining activites). Formatting the source code for a list so that the source code also appears as a list (as in the source code for this lesson) provides visual clues for the logical types and locations of tags.

The break tag is not a paired tag (does not have a closing tag). A single tag syntax requirement for some current browser capabilities is the inclusion of a space followed by a slash immediately before the "greater than" symbol (note this syntax in these break tags; this is not a requirement for older browser cababilities). Complying with this syntax simplifies the upgrading of web pages to current browser capabilities. This space-slash syntax is utilized for all single tags in all lessons herein.

The remaining code is comprised of the closing body tag and the closing html tag.

Lesson 2 Practice Activities

End of Lesson 2.