N
N
Nikita Shchypylov2016-05-28 11:55:16
css
Nikita Shchypylov, 2016-05-28 11:55:16

How to make a smooth hover per class?

Hello everyone , I
have this html:

<a class="outside" href="#">
            <div class="outside_hover cf">
              <i class="wood f_left"></i>
              <span class="f_left">Каркас и фундамент</span>
              <p class="f_left">Каркас и фундамент
              </p>
            </div>
          </a>

SCSS:
.outside{
      background: url("../img/shutterstock_336992036.jpg") no-repeat scroll center;
      background-size: cover;
      height: 668px;
      position: relative;
      display: block;
      transition:background 0.2s;
      &:hover {
      .outside_hover {
        display: block;
        margin: 0 auto;
        background: rgba(0, 0, 0, 0.8) none repeat scroll 0 0;
        @include size(100%, 668px);
        position: relative;

Now there is no smoothness, I do not know why. Any ideas?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Rikcon, 2016-05-28
@Rikcon

Show better on jsfiddle, xs what you have there in the transition mixin

A
Anton, 2016-05-28
Reytarovsky @Antonchik

js or css animation

V
Valery Zinchenko, 2016-05-28
@officialmuse

And in hover also specify transition, maybe it will work) or try
transition-duration: 0.2s;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question