130k views
1 vote
A selector starting with '.' is a ___ selector.

1 Answer

1 vote

Final answer:

A selector starting with '.' is known as a class selector in CSS, used to style HTML elements with the specified class attribute.

Step-by-step explanation:

A selector starting with a '.' is known as a class selector in CSS (Cascading Style Sheets). In web development, class selectors are used to select and stylize elements with the specified class attribute.

To use a class selector in CSS, you write a period followed by the name of the class, like this: .example. Any HTML element with the class attribute value 'example' will then be targeted by the CSS rules you define for that selector.

Example:

HTML: <div>This is a div element.</div>

CSS: .example { color: blue; }

With this example, every <div> element with the class 'example' will have its text colored blue.

User George Hanson
by
9.0k points