HTML Basics Worksheet

Answer the following questions by adding your answer to the DIV element below each question.

Question 1

What is the significance of the html element in an html document?

The html element is the the root element, which means that it contains all the other elements on the page.
Question 2

What is the purpose of the head element in an html document?

The head element contains a metadata and resources for webpage that aren't shown on the page.
Question 3

What is the purpose of the title element in an html document?

The title element defines the title of the webpage or document, which appears in the browser tab.
Question 4

What is the purpose of the body element in an html document?

The body element contains all the visible content of the document, such as text, images, links, and other element in the document.
Question 5

What is the difference between an inline element and a block element?

A block element tries to occupy as much horizontal space as available and stretch out to take up as much width. A inline element stays in line with the surrounding content and only big enough to accommodate its content.
Question 6

What is a self-closing tag?

A self-closing tage is a HTML element that doesn't contain any child content, it only uses an opening tag.
Question 7

Explain the syntax for adding an attribute to an HTML element?

To add an attribute to an HTML element, you write the attribute inside the opening tag and has a name with a value pair after the element name. Example: img src="../images/eagle.png" alt="An eagle"
Question 8

Add an H3 element that contains the content 'Hello World!'. Then add a class attribute to the H3 element and set the value of the attribute to "glow".

Hello World!