OK, if I have a div:
<div id="imgholder">
<img id="myimg" src = "foo.png">
</div>
I need the image to be no larger than 700px by 700px.
So I did this:
#myimg{
max-height: 700px;
max-width: 700px;
}
But now, I need the div to wrap tightly around the image. How can I do this? It seems like I would want a max height and width on there. The div defaults to being 100% of the body's height and width. So if I put a max height and width on it, it ALWAYS comes out to that height and width, even if the picture inside is smaller than that. How can I fix this?
EDIT: Realized I left out why it is defaulting to the height and width of the body:
#imgholder{
overflow: hidden;
z-index:1000;
background-color: #F0D2DB;
position: absolute;
margin: auto;
top: 0;
bottom: 0;
left:0;
right:0;
padding: 10px;
border-radius: 10px;
float: left;
}
I'm having it pop over the pages content, so I'm using the top,bottom,left, and right attributes to help center it.