.option01 {
text-align: right;
color: red;
}
Which HTML markup should a developer use to invoke the option01 selector in a paragraph?
Red color text
In order to apply the CSS class defined in the selector `.option01` to a paragraph, the correct HTML markup should include the class attribute with the appropriate class name. Therefore, the proper usage is in option D, where the class is correctly assigned.
Using an `id` attribute instead of a `class` will not invoke the `.option01` selector. The CSS class is defined with a dot prefix, indicating it should be applied with a class attribute, not an id. Thus, this option does not apply the desired styles.
This option is incorrect due to the improper syntax for the class attribute. The correct format requires the class name to be enclosed in quotes, as in `class="option01"`. Without quotes, this markup will not be valid HTML and will not apply the styles defined in the CSS.
Similar to option B, this choice uses an invalid syntax for the `id` attribute since it lacks quotes around the `id` value. Furthermore, even if corrected, using an id would still not invoke the class selector, which is defined for `.option01`.
This option correctly uses the class attribute to apply the styles defined in the `.option01` selector. The class name is properly enclosed in quotes, ensuring the paragraph will be rendered with the specified styles of right text alignment and red color.
To invoke CSS styles from a class selector, the appropriate HTML markup must use the `class` attribute with the correct syntax. Among the choices provided, option D is the only one that correctly adheres to these requirements, allowing the paragraph to display the intended styles as defined in the CSS. All other options either misuse attribute syntax or fail to reference the class selector properly, rendering them ineffective.
Related Questions
View allWhich HTML element is affected?
Which CSS rule hides the tag when the browser's width is 600 pixels w...
What is the value of a?
Which event occurs when a user closes a browser?
How long does it take to complete the transition from the time it begi...
Related Quizzes
View all0PC1 Planning Instructional Strategies for Meaningful Learning Version 1
AP01 Elementary Literacy Curriculum Version 1
AQ01 Applied Healthcare Statistics C784 Version 1
ASO1 Introduction to Statistics for Research Version 1
BJ01 Introduction to Business Finance Version 1
C172 Network and Security Foundations Version 1
C180 Introduction to Psychology Version 1
C180 Introduction to Psychology Version 2
CKC1 Introduction to Humanities Version 1
DZ01 Mathematics for Elementary Educators III MATH 1330 Version 1
- ✓ 500+ Practice Questions
- ✓ Detailed Explanations
- ✓ Progress Analytics
- ✓ Exam Simulations