Allen J. Bennett wrote: > I want to read the user's screen resolution, and adjust the width of > images depending on the result. Is this possible? I started this way, > but it seems not to be working (even when I did define [as a static > number, to start] IconWidth); I have NO idea how, or where, to define > it. When I get it working with a static number, then I have to figure > out how to read the screen resolution.
Finding "screen resolution" will not help much, and only a couple of the newest browsers can make anything out of "screen resolution" anyway. I think adjusting image-width based on browsers' window-width is what you're after, and all browsers in general use today can do that somewhat ok. Static numbers, or constants, don't exist in CSS (yet), and VBScript is of no use in CSS. However, browsers always know how wide a containing-element is, and can adjust other elements - including images - to a percentage of that width. > http://AffiliateDreams.com/Welcome.html Using your page as an example... Since you have not declared any fixed dimensions anywhere, all elements can be made to adjust in width to the body, which equals browser-window. As an example, copy this to your stylesheet: img {width: 8%; height: auto;} That style-rule will make all your images 8% wide relative to the browsers window-width and adjust height so the images scale with their correct proportions intact. Change width of browser-window to see how it works, and then give the percentage value for image-width you like. IE6 and older may not cooperate perfectly - have scaling-issues, but all new browsers will handle it well. Note that browsers generally do not do a good job of image-resizing, as no browser has photo-handling software's power for such a job. regards Georg -- http://www.gunlaug.no ______________________________________________________________________ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
