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 root element of an HTML document. It wraps all the content on the page, including the head and body sections.
Question 2

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

The head element contains metadata about the document, such as the title, character set, links to stylesheets, and other resources that are not displayed directly on the web page.
Question 3

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

The title element defines the title of the web page, which appears in the browser's title bar or tab. It also helps with search engine optimization.
Question 4

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

The body element contains all the visible content of the web page, such as text, images, links, and other HTML elements that are displayed in the browser.
Question 5

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

An inline element does not start on a new line and only takes up as much width as necessary. A block element starts on a new line and stretches the full width available.
Question 6

What is a self-closing tag?

A self-closing tag is an HTML tag that does not have a closing tag because it doesn't contain any content. It ends with /. Example: ;br /.
Question 7

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

An attribute is added inside the opening tag of an element using the format name="value". For example: img src="image.jpg" alt="A photo".
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!