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?

It tells the browser that the document is an HTML document and where the HTML content begins and ends.
Question 2

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

Contains information about the document, such as its title, character encoding, author, and description.
Question 3

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

The title element is what shows the name of the browser tab.
Question 4

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

Everything inside the <body> tag is rendered in the browser window — text, images, buttons, links, videos, etc.
Question 5

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

Block elements start on a new line and take up the full width available, while inline elements stay in line with surrounding text and only take up as much width as needed.
Question 6

What is a self-closing tag?

A self-closing tag is an HTML tag that doesn’t need a closing tag because it doesn’t wrap content — for example, <br /> or <img />.
Question 7

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

Attributes are added inside the opening tag using the format name="value", such as <img src="image.jpg" alt="description">.
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!