2014-08-28 84 views
0

出于某种原因,我的旋转元素不服从溢出规则?我怎样才能让我的轮换部门包含在母公司?旋转元素溢出

感谢您的提前帮助。

#box{ 
    float: left; 
    overflow: hidden; 
    background-position: center center; 
    background-repeat:no-repeat; 
    background-position: center center; 
    -webkit-background-size: cover; 
    -moz-background-size: cover; 
    -o-background-size: cover; 
    background-size: cover; 
} 

.full-width{ 
    width: 100%; 
    height: 900px; 
} 

#pull-out{ 
    width:1800px; 
    height: 1800px; 
    -ms-transform: rotate(45deg); 
    -webkit-transform: rotate(45deg); 
    transform: rotate(45deg); 
    background: #ffffff; 
    position: absolute; 
    right: -1273px; 
    top: -450px; 
} 


<div id="box" class="full-width" style="background-image: url(images/5.jpg)"> 
    <div id="pull-out"></div> 
</div> 

回答

0

这与内部div的定位有关。您需要使其相对于全宽div设置

position:relative; 

on .full-width div。

jsfiddle:http://jsfiddle.net/s8n88gce/1/