Glossary
Selector

Selector

A selector identifies and selects specific HTML elements to apply CSS styles to. This CSS rule involves selectors targeting elements according to their ID, class, type, attribute, and relationship with other elements.

For example, here's a code snippet defining a CSS selector:

p {

  color: green;

}

The p stands for paragraphs and is the selector. The brackets after p contain the styling properties and values. As a result, the selector chooses all the paragraphs on the web page and changes their color to green.

Here's another example where the class selector specifies that all elements with the header class must set their background color to black. The “.” character specifies the class.

.header {

  background-color: black;

}

Styling is integral to web design, allowing you to customize various elements. Visit Webflow University to learn how to use classes, states, and other tools to apply different CSS styles to your site.