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 of an HTML document, containing all other elements and indicating to the browser that it is an HTML file.
Question 2
What is the purpose of the head element in an html document?
The head element in an HTML document holds information about the page, like the title, styles, and scripts, which help the browser know how to display and handle the content.
Question 3
What is the purpose of the title element in an html document?
The title element sets the title of the webpage, which appears on the browser tab and is used as the page name in bookmarks.
Question 4
What is the purpose of the body element in an html document?
The body element in an HTML document contains all the visible content of the webpage, such as text, images, links, and other elements that the user sees and interacts with on the page.
Question 5
What is the difference between an inline element and a block element?
Block elements take up the full width of their container and start on a new line. While inline elements only take up as much width as necessary and do not start on a new line.
Question 6
What is a self-closing tag?
A self-closing tag is an HTML element that does not require a closing tag because it does not have any content.
Question 7
Explain the syntax for adding an attribute to an HTML element?
To add an attribute to an HTML element, you include the attribute name followed by an equal sign (=) and then the attribute value in quotes. The attribute is added inside the opening tag of the element.
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!