different css for different resolutions

liunx

Guest
i'm not 100% suer, so i have to ask. I have the javascript that will center and resize a table with a set height and width depending on the viewers resolution. However when I do this the text layout will display out of place. I can fix this with css, but what i'm wanting to have are different css files set active depending on the viewers resolution so the text will display the same in all layouts. (i've considered images, but i'm going with standard text for the load time) does someone have a link or have this documented?<br />
<br />
gears turn, lights burn, and the monkey's eyes widen<br />
chris<pixelmonkey>:monkey:<!--content-->Hey monkey....you want to page to render nicely in all rez, correct? Sounds like what your trying to do....though achieveable, might be complex. I knew a guy who would check screen size...then redirect to appropriate pages. I usually don't have problems with tables...I just put an empty data cell on all sides, and make it a percent height/ width. the inner cells can be set to pixel width/ height. This allwaos the 'inner' table cells to remain fixed, while the outer ones change to accomodate the screen size. <br />
<br />
heres a quick example of how I would use tables with mixed pixel/ percentage sizes.<br />
<br />
<html><br />
<head><br />
<title>Untitled</title><br />
</head><br />
<br />
<body><br />
<table width="100%" height="10%" cellpadding=0 cellspacing=0 border=1><br />
<tr><br />
<td>&nbsp;</td><br />
</tr><br />
</table><br />
<table width="100%" height="80%" cellpadding=0 cellspacing=0 border=1><br />
<tr><br />
<td width="35%">&nbsp;</td><td bgcolor="blue" width=100>&nbsp;</td><td width="35%">&nbsp;</td><br />
</tr><br />
</table><br />
<table width="100%" height="10%" cellpadding=0 cellspacing=0 border=1><br />
<tr><br />
<td>&nbsp;</td><br />
</tr><br />
</table><br />
</body><br />
</html><!--content-->thanks for the reply Dr.Web , but that doesnt help me. Does anyone else have any suggestions for activating a certin css file depending on resolution of the viewer?<br />
<br />
Note: I cant do this with cgi because the main pages in the site need to be editable with FP!<br />
<br />
if this monkey ever gets its hands on the Microsoft programers... ooo <br />
chris<pixelmonkey>:monkey:<!--content-->I don't really know if it is possible, or how to do it, but it seems like it could be done using a JAVA script to detect the resolution and depending on the results direct it to the appropriate CSS file. I need to learn JAVA.... :(<br />
<br />
Regards,<br />
Kevin<!--content-->heres the JS for screen size detection.......<br />
<br />
<br />
<br />
<br />
<html><br />
<head><br />
<title>Untitled</title><br />
<SCRIPT LANGUAGE="Javascript"><!--<br />
<br />
if (self.screen) { // for NN4 and IE4<br />
width = screen.width<br />
height = screen.height<br />
// Testing this first prevents firing the slow Java of NN4<br />
}<br />
else if (self.java) { // for NN3 with enabled Java<br />
var jkit = java.awt.Toolkit.getDefaultToolkit();<br />
var scrsize = jkit.getScreenSize(); <br />
width = scrsize.width; <br />
height = scrsize.height; <br />
}<br />
else{<br />
width = height = '?' // N2, E3, N3 w/Java off, probably Opera and WebTV<br />
<br />
}<br />
document.write("Your Screen Resolution is:");<br />
document.write(width +"×"+ height)<br />
//or whatever based on the above results<br />
<br />
//--></SCRIPT> <br />
</head><br />
<body><br />
<br />
</body><br />
</html><!--content-->
 
Back
Top