网页背景自适应分辩率并居中
作者:winxml 日期:2009-09-16
<style>
body{background:url(a.jpg) no-repeat top center;}
</style>
还有一种,根据分辩率来载入背景
<script language="javascript">
if((screen.width==1024)&&(screen.height==768)) {
document.write("<body background='b.jpg'>");
}
if((screen.width==1152)&&(screen.height==864)){
document.write("<body background='a.JPG'>");
}
</SCRIPT>
body{background:url(a.jpg) no-repeat top center;}
</style>
还有一种,根据分辩率来载入背景
<script language="javascript">
if((screen.width==1024)&&(screen.height==768)) {
document.write("<body background='b.jpg'>");
}
if((screen.width==1152)&&(screen.height==864)){
document.write("<body background='a.JPG'>");
}
</SCRIPT>
评论: 0 | 引用: 0 | 查看次数: -
发表评论
上一篇
下一篇

文章来自:
Tags: