Div Wrapped around image has border that exceed past image

devilmafia

New Member
I'm not sure if that title made sense but I'll try to explain to the best of my ability.I want to add a div basically on top of an image, which is simple. I wrap the image around a div and then give things like top:, left:, from that.Yet this div that the image is inside of exceeds the border of the actual image and goes all the way out to the parent div. How do I make it so that the border of the div just wraps around the actual image inside the div.Here is a JSFiddle example:http://jsfiddle.net/LCBradley3k/wwRhB/The black square is an image. But the div with the class of image, does not have a border that wraps around the image.\[code\]<div id="page"> <div class="image"> <img src="http://upload.wikimedia.org/wikipedia/commons/8/85/Black_300.jpg"> <div class="innerimage"></div> </div></div>\[/code\]
 
Back
Top