-
April 22nd, 2004, 01:16 PM
#1
Senior Member
changing website resolution
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
Mama always said, keep your virus definitions up to date.
-
April 22nd, 2004, 02:22 PM
#2
yes! It's possible if you're using table with width="100%"
PHP Code:
<table width="100%">
<tr>
<td width="20%"></td>
<td width="80%"></td>
</tr>
</table>
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%.
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.
-
April 22nd, 2004, 03:11 PM
#3
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
-
April 22nd, 2004, 03:27 PM
#4
Senior Member
i'd thought about using javascript but wasn't sure how to do it, thanks.
Mama always said, keep your virus definitions up to date.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|