Author |
Topic |
|
GoodMorningSky
Junior Member
122 Posts |
Posted - 15 January 2008 : 14:55:49
|
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
|
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 |
|
|
GoodMorningSky
Junior Member
122 Posts |
Posted - 15 January 2008 : 15:11:32
|
SO, is there a way make 100% of container? |
Software Engineer. MCSD.NET, SCWCD |
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 15 January 2008 : 15:14:45
|
Use CSS? |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 15 January 2008 : 15:17:38
|
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 |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 15 January 2008 : 15:19:25
|
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. |
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 15 January 2008 : 15:31:20
|
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 |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 15 January 2008 : 15:35:37
|
yep, it's the table that causes the problem
|
|
|
gary b
Junior Member
USA
267 Posts |
Posted - 16 January 2008 : 07:14:57
|
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. |
|
|
AnonJr
Moderator
United States
5768 Posts |
Posted - 16 January 2008 : 08:44:11
|
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. |
|
|
|
Topic |
|