how to write if condition in css

CSS
$type: monster;
p {
  @if $type == ocean {
    color: blue;
  } @else if $type == matador {
    color: red;
  } @else if $type == monster {
    color: green;
  } @else {
    color: black;
  }
}p.normal {
  background-position : 150px 8px;
}
p.active {
  background-position : 4px 8px;
}
Source

Also in CSS: