Inserting an image inside a Div ID with html/css

Permabanned
Joined
9 Oct 2006
Posts
1,012
Hello all, i'm trying to insert an image into a Div ID which would preferably stretch if need be to fit inside the box, or aligns to the left so it moves to the right, right now the Div ID simply defines a box with a background colour and a border, so I want to put images inside of it instead of text, but I cant seem to get the background image line to work either so i'm not 100% sure what the best way to do it would be, any help would be greatly appreciated
 
<div id="whatever">
<img src="pic.jpg" width="200" height="200" />
</div>

or

<style type="text/css">
#whatever {
background-image:url(pic.png);
}
</style>
 
Wheew ;D

I had this same problem, you have just potentially saved my entire web page design
:D

I was debating whether or not to resolve to tables and ruin my code, but you sir have prevented me from taking this horrible method ;D

Thanks :)
 
Back
Top Bottom