This is a discussion on "set CORRECT width for <img/>" within the Web Page Design section. This forum, and the thread "set CORRECT width for <img/> are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
set CORRECT width for <img/>
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
set CORRECT width for <img/>
Hi,
I am trying to set the width of an image correct and i dont seem to find out how... Here is the problem: I have a floating <div><div/> thingy on my site, and in here is an image. The image is sometimes bigger than the div-thing and the image will then just come outside of the div-box. By setting <img style="width=100%"> the image stays inside the div-box. So far so good! BUT, if the image is smaller (not as width as the div box), than the image it enlarged. How to prevent the image becomming bigger then it's actual size?? Thanks in advance |
|
|
|
||||
|
Re: set CORRECT width for <img/>
#foo {
width:; height:; overflow:hidden; }
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
|
|
|||
|
Re: set CORRECT width for <img/>
Whaw, that was quick
I have tryed (something) like that but it didnt work i show some example (the link below); If the window is too small to display the picture in its original size the picture will be resize smaller. (This is what i want ) And if you run this in a REALLY big window the picture will be enlarged. (That is NOT what i want, Instead I would like that the picture was shows in its original size) http://iersel.ie.funpic.org/bookmark.php?id=54 Last edited by iersel; Jul 26th, 2006 at 13:08. |
|
||||
|
Re: set CORRECT width for <img/>
Well, are you looking to do a thumbnail gallery or just have it fit to the image at any size?
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
|
|
||||
|
Re: set CORRECT width for <img/>
I have a very basic thumbnail gallery at http://www.newguyinennis.com/photography if that is somewhat what you are trying to accomplish. Alternately you could use javascript or similar to detect the image dimensions and write the div with the appropriate width and height but I am not sure that is the best solution to the problem.
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
|
|
|||
|
Re: set CORRECT width for <img/>
I am not sure if i understand your question correct.
If i run this page (http://iersel.ie.funpic.org/bookmark.php?id=54) in a fullscreen brower window (screen resolution 1600*1200) the image is bigger than its actual size. I would prefer to show the picture in its original size. If i run the same page in a really small window the picture will be displayed smaller than its actual size. That is what i want and is working correct now. So the question is how to have both cases working correctly at the same time? 1.) display the picture in a big window with its original dimensions (not working) 2.) display the same image in a small window with a correctly resized image (working) I have somehow to set the image max-width to its own width but i dont find a solution for it Thanks you for further assitence. (By the way, i am going out right now but ill be back tommorrow) |
|
|||
|
Re: set CORRECT width for <img/>
Are you using px or % to display it?
If you use % it will resize accordingly. |
|
|||
|
Re: set CORRECT width for <img/>
I see what you want, but this won't work without some kind of programming because you can't have both scenarios. If it can get smaller then it's allowed to get larger, just the nature of the beast.
|
|
|||
|
Re: set CORRECT width for <img/>
|
![]() |
| Tags |
| set, correct, width, ltimggt |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Pictures disappearing with correct width and height! | ChrisTheSoul | Web Page Design | 3 | Sep 3rd, 2007 21:56 |
| RAH (correct links) | Digger | Free Web Site Critique | 9 | Aug 29th, 2007 20:05 |
| Why isnt my website correct in IE? | artistxecrpting | Web Page Design | 3 | Jun 8th, 2007 12:26 |
| XML/RDF Example, is it correct? | Wheeler | Other Programming Languages | 0 | Oct 19th, 2005 17:48 |