pseudo in css code example

Example 1: pseudo class

Pseudo class

Example 2: pseudo class css

.element:nth-child(1)
.element:hover
.element:visited

Example 3: What is a pseudo selector?

A pseudo-class is a selector that selects elements that are in a specific state, e.g. they are the first element of their type, or they are being hovered over by the mouse pointer

Example 4: css pseudo classes

/* unvisited link */
a:link {
  color: #FF0000;
}

/* visited 
link */
a:visited {
  color: #00FF00;
}

/* mouse over link */

a:hover {
  color: #FF00FF;
}

/* selected link */
a:active {

  color: #0000FF;
}

Example 5: css pseudo classes

button/anchor:hover / :active / :checked
:nth-of-type(3) // select the third element
:nth-of-type(3n) // select an element every three

Tags:

Css Example