Hi Patrick, Thanks, but when I tried to insert "onresize" into the <body> tag it told me it was invalid. Also if only "CSS3 Media Queries" were compatible, that suggestion was man July 2002!!! Anyway I don't want to get off-topic, does anybody has a solution for what I am trying to achieve? I had a look at the "A List Apart" style switcher, but this is only if the user "clicks" on a link. And the JS function doesn't check the users browser width, then select the correct stylesheet. So I need the site to check the users browser width, then load the correct stylesheet, HOWEVER, if the user resizes their browser, and the browser goes below 800px wide then I want the page to automaticall swap the stylesheet.
Thanks everyone, this would be really useful, because the client I am building for is saying that when they view the site I have built in their 1600x1200 resolution it looks too "stretched" across their screen, and looks odd. And they asked me if I can set the to stop increasing its width when it reaches 1024px wide. But the "max-width" CSS attribute doesn't work in IE!! So instead I have to resort to having two stylesheets, cause if I set one of the stylesheets to 1024px wide MAX, if I was to view that in 800x600, I would get a horizontal scroller. So instead I need to automatically load in the stylesheet that has all its widths optimised for 800x600 or less. Thanks again everyone. --------------------------------- Unless I'm mistaken, "resize" is still accepted as a DOM event. http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html No time to test, but you should be able to programmatically attach this event to your document's body. Patrick ****************************************************** The discussion list for http://webstandardsgroup.org/ See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help ******************************************************