KnowledgeBoat Logo
|

Computer Applications

What would this CSS rule do ?

h2  {   font-size:2em; 
    }
  1. Make fonts in a specific h2 tag double in size.
  2. Make fonts in all h2 tags double in size.
  3. Make fonts in all h2 tags double in size and italic.
  4. Make all fonts that are size 2, empty.

CSS

3 Likes

Answer

Make fonts in all h2 tags double in size.

Reason — The breakup of the rule is as follows:

  • h2 is a selector in CSS, which targets all <h2> elements. In HTML, <h2> represents a heading level 2.
  • {} encloses the declaration block, which contains one or more property-value pairs.
  • font-size:2em; is a property-value pair within the declaration block. Here, the font-size property is set to 2em. The value 2em means the font size will be twice the size of the default font size.

So, applying this CSS rule to an HTML page would result in all heading level 2 elements (<h2>) being displayed with a font size that is twice the default font size.

Answered By

1 Like


Related Questions