0

我发现了这个:hover效果的一个问题,这是我以前从未见过的。当我:hover在 div“框”上时……这会改变背景的一部分……

谢谢 !

部分的 CSS

.first { background:#fff; width:100%; height:auto; position:relative;}     

.second {background-image:url(../images/body/1.jpg); background-attachment:fixed;width:100%; height:auto; position:relative; display:inline-block;}

HTML

<div class="span4 one">
    <i class=" icon-4x icon-beaker">
    </i>
    <h2>
        Awesome
    </h2>
    <p>
        Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam
        id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta
        ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel
        scelerisque nisl consectetur et.
    </p>
    <button type="submit">
        shown more
    </button>
</div>  

盒子的 CSS

 .boxes .span4{text-align:center; padding:10px 0; display:inline;
    -webkit-transition: all 300ms linear;
       -moz-transition: all 300ms linear;
         -o-transition: all 300ms linear;
        -ms-transition: all 300ms linear;
            transition: all 300ms linear;}

==>.boxes .span4:hover {background: rgba(51,153,255,0.1);}<=== 
4

1 回答 1

1

它看起来不像background-attachment: fixed;直线平移(它基本上改变了背景图像的固定位置,具体取决于它上面在 Y 轴上平移的元素)

于 2013-02-28T00:26:34.980 回答