css里面如何设置body背景图片满屏

html-css014

css里面如何设置body背景图片满屏,第1张

<!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>

<!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>