M
M
mUchenik2018-08-15 12:49:54
Sass
mUchenik, 2018-08-15 12:49:54

How to properly set the :hover effect in sass?

The hover effect does not work
, here's how I write it in sass:

button.btn.btn-inverse.btn-block.btn-lg.dropdown-toggle{
  background-image: linear-gradient(to bottom, #6eae45)}
  button.btn.btn-inverse.btn-block.btn-lg.dropdown-toggle:hover{
    background: #fff;
}

What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arseny, 2018-08-15
Matytsyn @ArsenyMatytsyn

1. It makes no sense to list all the classes that hang on the button
2. Do not forget that CSS is primarily cascading styles, i.e. the first entry takes precedence, as it was written for a specific case, for image
3. This is not SASS syntax, this is plain CSS in a .scss file. The second description should be inside the first one in the &:hover format
4. Observe the culture of writing code, comrade, shame on you.

button.sigleclass { /*Если прямо совсем уникальная кнопка, имеет смысл повесить id*/
    background-image: linear-gradient(to bottom, #6eae45, [второй цвет]);
    &:hover {
        background-color: #fff;
    }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question