CSS Selectors

CSS Selectors

CSS selectors are used to "find" (or select) the HTML elements you want to style.
We can divide CSS selectors into five categories:
This page will explain the CSS simple selectors.

The CSS element Selector 

The element selector selects HTML elements based on the element name. 
{
  text-align: center;
  color: red;
}



All CSS Simple Selectors

SelectorExampleExample description
.class.introSelects all elements with class="intro"
#id#firstnameSelects the element with id="firstname"
**Selects all elements
elementpSelects all <p> elements
element,element,..div, pSelects all <div> elements and all <p> elements
Every paragraph will be affected by the style.
Me too!
And me!

0 коммент.