KnowledgeBoat Logo
|

Computer Applications

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.

CSS

5 Likes

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.

Answered By

2 Likes


Related Questions