将div恰好放在另一个之后

时间:2015-07-21 00:17:04

标签: css

我想将.image完全置于.description-wrap之后。我已经尝试过使用填充和边距使其居中,但是没有去。

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

https://jsfiddle.net/vsdLk90s/

1 个答案:

答案 0 :(得分: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