背景图片居中、平铺等设置方法网页背景没有拉申功能,
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>
///////////////-----------/////////////////////
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>');
}
//
</script>
///////////////-----------/////////////////////
