Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to stop large image breaking out of DIV section?

Status
Not open for further replies.

Crowley16

Technical User
Jan 21, 2004
6,931
GB
basically, I've got a number of images that are going over the width of my div, however I don't know which ones will be going over or...

so I'd like to be able to have something that can tell if the right edge of a image is going over my div, and if so, then resize the image...

I'm new to javascript, but am more than willing to learn and fiddle if someone was to point me in the right direction.

Thanks
 
Check few posts below - there is a topic named "How to FIX a table size so image cannot grow?". DIV or TABLE, problem is the same. :)
 
I have read that post already...

it doesn't help, I've already "fixed" the width of the DIV and positioned it...
Also, I need to reduce the size of the picture to make it fit...

to clarify further:
this picture is in a 2nd div that's indented by a little. So even if I could just get the picture to move left by a bit, it would be ok.
However, I do not know if the picture will go over or not, I'm using xslt to format a xml file, so can't just put a left:-20px on it...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top