CBSE Class 10 Computer Applications
Question 24 of 37
Cascading Style Sheets (CSS) — Question 4
Back to all questions 4
Question Question 4
What would this CSS rule do ?
h2 { font-size:2em;
}
- 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.
Make fonts in all h2 tags double in size.
Reason — The breakup of the rule is as follows:
h2is 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, thefont-sizeproperty is set to2em. The value2emmeans 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.