Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 Image width=100% doesn't work with IE?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

GoodMorningSky
Junior Member

122 Posts

Posted - 15 January 2008 :  14:55:49  Show Profile
Hi all,
img tag's width 100% doesn't work. It works with firefox.

Is there way to make img width=100% work ok?

see the following example.

<table width="200px"  border="1"><tr><td>
<img width="100%"  src="http://www.community4pets.com/SitePortal/data/__petspace_write/item_ini__a117baedb3.JPG" alt="Community4Pets.com picture" />
</td></tr></table>

Software Engineer.
MCSD.NET, SCWCD

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 15 January 2008 :  15:02:30  Show Profile  Visit HuwR's Homepage
works ok in IE for me, what version are you using ?

scratch that, I seee what you mean, IE takes the 100% to mean the images width, not that it will be 100% of it's container which is what FF does, dificult to say which one is correct
Go to Top of Page

GoodMorningSky
Junior Member

122 Posts

Posted - 15 January 2008 :  15:11:32  Show Profile
SO,
is there a way make 100% of container?

Software Engineer.
MCSD.NET, SCWCD
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 15 January 2008 :  15:14:45  Show Profile  Visit AnonJr's Homepage
Use CSS?
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 15 January 2008 :  15:17:38  Show Profile  Visit HuwR's Homepage
use divs not tables, or explicitly set the image width in px, it really depends why/what you are doing with the image (it isn't generally a god idea to let the browser scale the images anyway
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 15 January 2008 :  15:19:25  Show Profile  Visit HuwR's Homepage
quote:
Originally posted by AnonJr

Use CSS?



doesn't work the problem is that IE sets the table cells width to the images actual size, not the width that you set it too, regardless of how you set the width.
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 15 January 2008 :  15:31:20  Show Profile  Visit AnonJr's Homepage
Just a thought.

I'm using CSS to size the background image over at www.jesusjoshua2415.com - but its also in a <div>

Edited by - AnonJr on 15 January 2008 15:32:40
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 15 January 2008 :  15:35:37  Show Profile  Visit HuwR's Homepage
yep, it's the table that causes the problem

Go to Top of Page

gary b
Junior Member

USA
267 Posts

Posted - 16 January 2008 :  07:14:57  Show Profile  Visit gary b's Homepage
quote:
SO, is there a way make 100% of container?

There are two ways of looking at this...
Image is too small for the container. Therefore, increase size of image. One possible problem increasing image 'width' is that it will distort the image -- increase in width but no *proportional* increase in height.

OR

Container is too large for image ==> reduce container size.

My thoughts... set fixed size of image but NO size for table column. Set other column sizes to take larger percentage of width and let the image 'force' itself into the column. Obviously, other factors weigh in -- such as width requirements for other columns, etc.
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 16 January 2008 :  08:44:11  Show Profile  Visit AnonJr's Homepage
The real problem is that we don't have any context - there are probably numerous ways of getting what they want ... if we knew the context of the problem. It comes back to what HuwR posted earlier - we need to know what they are trying to do.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.22 seconds. Powered By: Snitz Forums 2000 Version 3.4.07