Is it possible to display a certain website depending on a person's screen resolution?
i.e.
If person's resolution = 640x480 go to this link
otherwise go to this link
Printable View
Is it possible to display a certain website depending on a person's screen resolution?
i.e.
If person's resolution = 640x480 go to this link
otherwise go to this link
yes! It's possible if you're using table with width="100%"
This will make a table that take 100% of the screen users with 2 colums. First one will take 20% of the screen size and the other 80%.PHP Code:<table width="100%">
<tr>
<td width="20%"></td>
<td width="80%"></td>
</tr>
</table>
You can also do this
<table width="100%">
<tr>
<td width="200"></td>
<td width=*></td>
</tr>
</table>
[/PHP]
First colums will take 200 pixels and the second, the rest of the screen.
You could also use javascript to detect resolutions. This works in Netscape 4 and higher, and IE5 and higher.
<script language="javascript">
<!--
if ((screen.width>=1024) && (screen.height>=768))
{
window.location="1024x768.html";
}
else
{
window.location="lowerresolution.html";
}
//-->
</script>
This will allow you to create high resolution designs without having to worry about scrolbars for people with 800x600 or lower.
cheers
i'd thought about using javascript but wasn't sure how to do it, thanks.