Forum Moderators: not2easy

Message Too Old, No Replies

Keeping Images inside a DIV tag?

having problems with images (and other elements) overflowing...

         

Matt McInvale

9:25 pm on Oct 17, 2003 (gmt 0)

10+ Year Member



Hello.

I am having problems with images overflowing my DIV tags. Here is an example of something i use.

.example
{
border:dashed #999999;
border-width:0px 1px 1px 1px;
background: #FFFFFF;
text-align: justify;
padding:5px 15px 5px 15px;
}

<div class='example'>
<img src='images/thisthat.gif' alt='' align='right'> here is some text in here for this example and what not. blah.
</div>

the image will expand past the boundries of the div. how can i keep it within it? i also have the same problem with nested DIV tags.....

i searched and didnt find anything..... thanks :)

Reflection

10:47 pm on Oct 17, 2003 (gmt 0)

10+ Year Member



First you should give you img width and height attributes.

You might also want to define the widht of your divs.