English

What would this CSS rule do? h2 { font-size: 2em; }

Advertisements
Advertisements

Question

What would this CSS rule do?

h2  {  font-size: 2em;
    }

Options

  • Make fonts in a specific h2 tag double in size.

  • Make fonts in all h2 tags double in size.

  • Make fonts in all h2 tags double in size and italic.

  • Make all fonts that are size 2, empty.

MCQ
Advertisements

Solution

Make fonts in all h2 tags double in size.

Explanation:

The rule is broken down as follows:

  • All <h2> elements are targeted by the CSS selector h2. <h2> in HTML denotes a heading level 2.
  • The declaration block, which has one or more property-value pairs, is enclosed by {}.
  • The declaration block has a property-value pair called font-size:2em;. The font-size property is set to 2em. The font size will be double that of the normal font size if the value is 2em.

Therefore, all heading level 2 elements (<h2>) would be shown with a font size that is double the default font size if this CSS rule were applied to an HTML page.

shaalaa.com
  Is there an error in this question or solution?
Chapter 6: Cascading Style Sheets (CSS) - Assignment [Page 274]

APPEARS IN

Sumita Arora Computer Applications [English] Class 10
Chapter 6 Cascading Style Sheets (CSS)
Assignment | Q 4. | Page 274
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×