Simple HTML CSS Quiz

Description: Simple HTML CSS Quiz
Number of Questions: 6
Created by:
Tags: css html
Attempted 0/6 Correct 0 Score 0

Which values for font-family property is valid?

  1. Times New Roman, serif

  2. “Times New Roman”, serif

  3. Times New Roman; serif;

  4. &quotTimes New Roman”; “serif”;


Correct Option: B

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) Times New Roman, serif - This option is incorrect because the font names should be enclosed in quotation marks when using the font-family property.

Option B) "Times New Roman", serif - This option is correct because it uses quotation marks to enclose the font names, which is the correct syntax for the font-family property.

Option C) Times New Roman; serif; - This option is incorrect because it uses semicolons instead of commas to separate the font names. Commas should be used to separate multiple font names in the font-family property.

Option D) &quotTimes New Roman"; "serif"; - This option is incorrect because it uses HTML entity codes (&quot) instead of quotation marks to enclose the font names. Quotation marks should be used to enclose the font names in the font-family property.

The correct answer is B) "Times New Roman", serif. This option is correct because it uses the correct syntax and format for the font-family property by enclosing the font names in quotation marks.

Which property applies a color to text?

  1. text-color

  2. foreground-color

  3. background-color

  4. color


Correct Option: D

AI Explanation

To answer this question, you need to understand CSS, specifically the properties used to apply color to text.

Option A) text-color - This option is incorrect because there is no CSS property called "text-color". The correct property name is "color".

Option B) foreground-color - This option is incorrect because there is no CSS property called "foreground-color". The correct property name is "color".

Option C) background-color - This option is incorrect because the "background-color" property is used to apply color to the background of an element, not the text itself.

Option D) color - This option is correct because the "color" property is used to apply a color to the text content of an element. This property accepts various color formats such as named colors, hexadecimal values, RGB values, and HSL values.

The correct answer is D) color. This option is correct because the "color" property is specifically designed to apply a color to text.

In what form are style rules presented?

  1. selector { property: value }

  2. selector { property= value }

  3. selector ( property: value )

  4. selector ( property= value )


Correct Option: A

AI Explanation

To answer this question, you need to understand how style rules are presented in CSS (Cascading Style Sheets).

Option A) selector { property: value } - This option is correct because it represents the correct syntax for a style rule in CSS. The selector is the HTML element or class that you want to apply the style to, followed by a set of curly brackets {}. Inside the curly brackets, you define the properties and values that you want to apply to the selected element.

Option B) selector { property= value } - This option is incorrect because it uses the wrong syntax. In CSS, properties and values are separated by a colon (:), not an equals sign (=).

Option C) selector ( property: value ) - This option is incorrect because it uses parentheses instead of curly brackets to define the style rule. Parentheses are not used in CSS for this purpose.

Option D) selector ( property= value ) - This option is incorrect for the same reason as Option C. Parentheses should not be used to define style rules in CSS.

The correct answer is A) selector { property: value }. This option uses the correct syntax for defining style rules in CSS.

  1. Apply the style to a specific element

  2. Apply the style to all the elements

  3. Apply the style to a group of elements

  4. Apply the style to elements of the same type


Correct Option: A

A ___________ consist of a property and a value,

  1. Tag

  2. Attribute

  3. Deceleration

  4. This is H1

  5. h1 {color: red;}


Correct Option: C

Fill in the following:

  1. selector

  2. attribute

  3. property

  4. decleration


Correct Option: B
- Hide questions