CSS中背景图片的设置

CSS中背景图片的设置:
不平铺:background-repeat: no-repeat;
横向平铺:background-repeat: repeat-x;
纵向平铺:background-repeat: repeat-y;
固定:background-attachment: fixed;
滚动:background-attachment: scroll;
水平居中:background-position: center;
水平居中并垂直居中:background-position: center center;
根据屏幕大小来显示相应大小的图片
<SCRIPT LANGUAGE=”JavaScript1.2″>

<!– Begin
if (screen.height >= 768 && screen.width >= 1024) {
document.write(“<img src=’1024.jpg’ width=1024 border=0>”);
}
else {
if (screen.height == 600 && screen.width == 800) {
document.write(“<img src=’800.jpg’ width=800 border=0>”);
}
else {
document.write(“<img src=’1024.jpg’ width=300 border=0>”);
}
}
// End –>
</script>

发布者

Zmsky

http://xloli.net/?page_id=11

发表评论

This site uses Akismet to reduce spam. Learn how your comment data is processed.