In the following snippet, CSS defines .right { text-align: right; } HTML uses <h3 class="right">Right-aligned heading level three</h3>. The code demonstrates which type of selector?

Prepare for the uCertify CIW Advanced HTML5 and CSS3 Specialist Exam. Dive into essential topics with flashcards and multiple-choice questions. Enhance your understanding with hints and explanations for each question. Pass your exam confidently!

Multiple Choice

In the following snippet, CSS defines .right { text-align: right; } HTML uses <h3 class="right">Right-aligned heading level three</h3>. The code demonstrates which type of selector?

This uses a class selector. In CSS, a dot followed by a name (.right) targets any element that has that class. The HTML assigns class="right" to the h3, so the rule applies to that heading and makes its text align to the right. It’s not an id selector because there’s no # or id attribute involved. It’s not a descendant selector because there’s no relationship like a parent and child encoded in the selector. It isn’t inline style since the styling comes from the CSS rule, not from a style attribute on the HTML element. If multiple elements shared class="right", they would all be right-aligned.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy