简体   繁体   中英

CSS auto height doesn't stretch when overflow is visible

I have a div containing an image that is positioned slightly outside of the box. The div also containing another div with text. When I set the height to auto to allow it to expand with the amount of text the image is clipped and doesn't appear over the edge. I've tried using z-index but this is helping.

Here is what I have:

#package {
width: 700px;
height: auto;
background-color: #FFF;
border-radius: 20px;
-moz-border-radius: 20px;
margin: 0 auto;
padding: 15px 15px 15px 15px;
margin-top: 50px;
margin-bottom: 0px;
overflow: visible;
}

#packageinfo {
text-align: left;
width: 200px;
height: auto;
float: right;
}

#package .image {
float: left;
margin-left: -30px;
margin-top: -30px;
z-index: 500;
}

Hi your code and some error in it. at the end of the table the td an tr was inverted.

there was missing a div closing tag.

I've fixed that and add a clear div.

here is a link http://jsfiddle.net/etienne_carre/qB6Ye/11/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM