The correct answer is: B. Selector
A selector is a string of characters that identifies a set of elements in an HTML document. It is used to apply a style declaration to those elements.
A tag is a markup element that defines a part of an HTML document. It is used to specify the type of content that is contained in the element.
A declaration is a statement in a CSS stylesheet that specifies the value of a property. It is used to change the appearance of an element.
A class is a way of grouping elements together. It is used to apply the same style to multiple elements.
Here is an example of a selector:
p {
color: red;
}
In this example, the selector is p
. It specifies that the style declaration should be applied to all p
elements in the HTML document.
Here is an example of a tag:
“`
This is a paragraph.
“`
In this example, the tag is p
. It defines the content of the element as a paragraph.
Here is an example of a declaration:
color: red;
In this example, the declaration is color
. It specifies that the color of the element should be red.
Here is an example of a class:
.myClass {
color: blue;
}
In this example, the class is myClass
. It can be used to apply the same style to multiple elements.