<html>
<head>
<style>
body{
width:960px//通过id来控制
height:600px
}
</style>
</head>
<script>
document.body.style.backgroundcolor = "#f00" //通过JS来改变
</script>
<body style="width:900pxheight:400px">
</body>
</html>
<!doctype html><html><head><meta charset="utf-8"><title>无标题文档</title><style>html{width:100% height:100%}body{width:100% height:100% background: url(../1.jpg) no-repeat background-size:cover /*这里设置了背景图片为覆盖,以填满整个容器*/ }</style></head> <body></body></html>