13.10. HTML

HTML stands for Hyper Text Markup Language. It is used to create web pages. HTML describes the elements of the webpage such as the title, paragraphs, images, and links. For more information on HTML see the tutorial at https://www.w3schools.com/html/.

HTML uses tags to describe the elements of the document. Tags are enclosed in “<” and “>”.

Note

HTML is not a programming language. It is a markup language for describing documents.

Click on the “Render” button to see the resulting web page.

The first tag, <!DOCTYPE html>, indicates that this is an HTML document. While it is best to include this tag, the page will typically display fine even if you don’t include it.

The html tag is the root (start) tag for the document.

The head tag contains meta information about the document such as the title.

The body tag contains the items that will be displayed.

The h1 tag is for a first-level (most important) header. There are additional types of headers: h2, h3, etc.

The p tag indicates a paragraph of text.

Try adding a h2 and h3 header to the HTML above after the paragraph. How does the display change for each type of header?

13.10.1. Start and End Tags

Most HTML elements have start tags and end tags. The page is started with the start tag <html> and ends with the end tag </html>. Indentation isn’t required, but can make it easier to read the HTML.

Fix the errors in the HTML below so that every start tag has an end tag and every end tag has a start tag.

13.10.3. List Tags

You can include both ordered (numbered) and unordered (bulleted) lists in HTML.

Render the HTML below.

Render the HTML below.

13.10.4. Tag Relationships: Parent, Child, Sibling

The HTML tag has two children tags: <head> and <body>. The head contains meta information about the page including the page title. The body contains the elements that are displayed in the page such as the headers and paragraphs.

Put the blocks into order to define a simple HTML page. Indent the blocks to show the structure.

In an HTML page the root element is the “html” tag. A root is the start of a structure. This type of structure is called a tree. The html tag has two children elements: the head and body tags. These tags are called sibling tags since they share the same parent tag. The parent for the head and body tags is the html tag. The body tag is the parent of the h1 and p tags.

A Tree Representation of an HTML page
You have attempted of activities on this page