CSS Selectors
CSS selectors allow you to target specific elements to apply styles. Here are some commonly used selectors:
Class Selector: Targets elements with a specific class. For example:
.my-class {
color: red;
}
ID Selector: Targets a specific element with a unique ID. For example:
#my-id {
font-weight: bold;
}
Descendant Selector: Targets elements that are descendants of another element. For example:
.parent-element .child-element {
background-color: blue;
}
No comments:
Post a Comment