Tag: html

Questions Related to html

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.

  1. selector { property: value }

  2. selector { property= value }

  3. selector ( property: value )

  4. selector ( property= value )


Correct Option: A
  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