How to apply a style to several specific element types?
-
Use the type selector with , delimiter
-
Use the ID selector with ; delimiter
-
Use the type selector with . delimiter
-
Use the ID selector with > delimiter
In CSS, multiple element type selectors can be grouped together by separating them with commas to apply the same style rules to all of them.
To apply a style to several specific element types, you can use the type selector with a period (.) delimiter.
Option A) Use the type selector with , delimiter - This option is incorrect. The comma (,) delimiter is used to select multiple elements of different types, not specific element types.
Option B) Use the ID selector with ; delimiter - This option is incorrect. The semicolon (;) is not used as a delimiter for selecting multiple element types.
Option C) Use the type selector with . delimiter - This option is correct. You can use the type selector (e.g., p, div, h1) with a period (.) delimiter to select multiple elements of the same type.
Option D) Use the ID selector with > delimiter - This option is incorrect. The greater than symbol (>) is used to select a direct child element, not to select multiple element types.
The correct answer is C) Use the type selector with . delimiter. This option is correct because it allows you to apply a style to multiple elements of the same type by using the type selector followed by a period (.) delimiter.