2015-07-21 40 views
2

我想将.image正好落后于.description-wrap。我试过使用填充和边距来居中,但没有去。将div正好落后于另一个

.image img { 
display:block; 
margin: 0 auto; 
width:30%; 
bottom:100px 
} 

https://jsfiddle.net/vsdLk90s/

+0

你只是想通过另一个叠加一个元素? – DavidG

+0

@DavidG Yup。我只是想让图像完全位于文本的下方。我有这种需要发生的多个实例。 – user2252219

+0

因此,给'description-wrap'元素一个'position:absolute;' – DavidG

回答

2

我已经做了一些改动你的代码,并在注释中解释它们。

.image { 
    position: absolute; /* Out of flow of current structure */ 
    width: 70%; /* To regain the width of previous layout */ 
    margin-top: -15%; /* Align it vertically */ 
    z-index: -1; /* Priority reordering, place the image underneath the text */ 
} 

JSfiddle