CBSE Class 10 Computer Applications Question 23 of 37

Cascading Style Sheets (CSS) — Question 3

Back to all questions
3
Question

Question 3

What would this CSS rule do ?

p   {   color:red; 
    }
  1. Make the background of all paragraphs red.
  2. Make the fonts of all paragraphs red.
  3. Make all text boxes red.
  4. Make the border of all paragraphs red.
Answer

Make the fonts of all paragraphs red.

Reason — The breakup of the rule is as follows:

  • p is a selector in CSS, which targets all <p> elements. In HTML, <p> elements represent paragraphs.
  • {} encloses the declaration block, which contains one or more property-value pairs.
  • color:red; is a property-value pair within the declaration block. Here, the color property is set to red, which means the text color of all <p> elements will be changed to red.

So, applying this CSS rule to an HTML page would result in all paragraphs being displayed with red text color.