Online Coding Lessons HTML and CSS Web Development 2 — Questions and Answers
Question 1: Which HTML tag is used to define an unordered (bulleted) list?
- <ol>
- <li>
- <ul> (Correct answer)
- <list>
Correct answer: <ul>
The <ul> tag defines an unordered list with bullet points, while each item is wrapped in <li> tags.
Question 2: What is the correct CSS syntax to make all <p> elements bold?
- p {text-size: bold}
- p {font-weight: bold} (Correct answer)
- p {font-style: bold}
- <p style='bold'>
Correct answer: p {font-weight: bold}
The CSS property 'font-weight: bold' is used to make text bold when applied to a selector.
Question 3: What does CSS stand for?
- Computer Style Sheets
- Cascading Style Sheets (Correct answer)
- Creative Style Syntax
- Colorful Style Sheets
Correct answer: Cascading Style Sheets
CSS stands for Cascading Style Sheets, the language used to style and layout HTML elements on web pages.
Question 4: Which HTML element is used to define the structure/title shown in the browser tab?
- <header>
- <meta>
- <title> (Correct answer)
- <head>
Correct answer: <title>
The <title> element inside the <head> section defines the text shown in the browser's tab and title bar.
Question 5: Which CSS property is used to change the background color of an element?
- color
- bg-color
- background-color (Correct answer)
- fill
Correct answer: background-color
The 'background-color' CSS property sets the background color of an HTML element.
Question 6: What is the purpose of the <div> tag in HTML?
- To display an image
- To create a division/section for grouping elements (Correct answer)
- To divide a number
- To create a dropdown menu
Correct answer: To create a division/section for grouping elements
The <div> tag is a generic container element used to group and structure HTML content into sections.
Which HTML tag is used to define an unordered (bulleted) list?