背景色悬停

时间:2018-09-20 19:08:09

标签: css hover background-color

它们如何使悬停时的背景颜色看起来像这样,而不是在“关于”和“案例研究”区域上看起来像一个方框? http://clorova.com/

2 个答案:

答案 0 :(得分:0)

他们使用了一张图片:

http://clorova.com/assets/img/general/hover.png

如果仅检查页面,则会看到CSS:

.flare-hover:before {
    content: '';
    position: absolute;
    width: 450px;
    height: 450px;
    background-image: url(../img/general/hover.png);
    background-size: cover;
    top: -200px;
    left: -100px;
    opacity: 0;
    pointer-events: none;
    -webkit-transition: all 0.2s ease;
    -moz-transition: all 0.2s ease;
    -o-transition: all 0.2s ease;
    -ms-transition: all 0.2s ease;
    transition: all 0.2s ease;
    -webkit-transform: scale(0.4);
    -moz-transform: scale(0.4);
    -ms-transform: scale(0.4);
    -o-transform: scale(0.4);
    transform: scale(0.4);
}

答案 1 :(得分:0)

他们在:: before上使用图片

  .flare-hover:before {
        content: '';
        position: absolute;
        width: 450px;
        height: 450px;
        background-image: url(../img/general/hover.png);
        background-size: cover;
        top: -200px;
        left: -100px;
        opacity: 0;
        pointer-events: none;
        -webkit-transition: all 0.2s ease;
        -moz-transition: all 0.2s ease;
        -o-transition: all 0.2s ease;
        -ms-transition: all 0.2s ease;
        transition: all 0.2s ease;
        -webkit-transform: scale(0.4);
        -moz-transform: scale(0.4);
        -ms-transform: scale(0.4);
        -o-transform: scale(0.4);
        transform: scale(0.4);
    }
相关问题