Answers for "ampersand css"

CSS
3

scss hover

.class {
    margin:20px;
    &:hover {
        color:yellow;
    }
}
Posted by: Guest on June-20-2020
1

ampersand css

//there is a lot of repetition
.button:visited {
  //style goes here
}
.button:hover {
  //style goes here
}
button:active {
  //style goes here
}
//this can be simplified by using an ampersand
.button {
  &:visited { }
  &:hover { }
  &:active { }
}
Posted by: Guest on March-31-2021

Browse Popular Code Answers by Language