传奇世界嗜血至尊屠龙:如何做出自动适应分辨率的网页?

来源:百度文库 编辑:高考问答 时间:2024/05/01 05:26:44
比如我在1280X1024下做的网页,如何让它自动适应在1024X768分辨率下的屏幕显示中???????具体方法?????

宽度不要用像素,用百分比

<script LANGUAGE="JavaScript">
<!-- Begin
function redirectPage() {
var url640x480 = "http://www.163.com/";
var url800x600 = "http://www.toto369.net/";
var url1024x768 = "http://www.sina.com/";
if ((screen.width == 640) && (screen.height == 480))
window.location.href= url640x480;
else if ((screen.width == 800) && (screen.height == 600))
window.location.href= url800x600;
else if ((screen.width == 1024) && (screen.height == 768))
window.location.href= url1024x768;
else window.location.href= url640x480;
}
// End -->
</script>

<body onload="redirectPage()"></body>
只要把代码的那些网址改称你的网页网址就可以了