Log in

View Full Version : 'Narrow' stylesheet



marynorn
02-25-2008, 11:53 AM
I've designed a website which is having issues at 800x600. I'm using a 'handheld' stylesheet for PDAs and phones, and I was hoping to find a similarly quick and easy way to modify any screen res under 1024x768. I know that uk.yahoo has a 'narrow' style, as my Q1 tablet picks it up; anyone know how they do this?

boogyman
02-25-2008, 03:19 PM
You can assign a different CSS stylesheet to different types of "media"

for a list of media types see http://www.w3.org/TR/REC-CSS2/media.html#media-types

marynorn
02-25-2008, 03:59 PM
Yep, I know all about those. I'm using handheld and print stylesheets already. I'm interested in knowing how to have an alternate stylesheet load on detection of an 800x600 screen resolution. I can put in a link saying 'narrow layout', but I'd rather have the page load as narrow.

Now I come to think about it, that's probably not a CSS problem.

Medyman
02-25-2008, 11:40 PM
Now I come to think about it, that's probably not a CSS problem.


I guess not...
You could fix it with CSS though by making your layout fluid.

DD has some fluid layouts if you need help with the CSS.

Otherwise, javascript:


<SCRIPT language="JavaScript">
<!--
if ((screen.width>=1024) && (screen.height>=768))
{
regular css
}
else
{
narrow css
}
//-->
</SCRIPT>

marynorn
02-26-2008, 08:37 AM
Oh, nifty! I hadn't thought of javascript. Thanks.