如题所述
ç¨background-positionå±æ§æ¥å®ç°ã
åè代ç ï¼
<html><head>
<style type="text/css">
body
{
background-image:url(/i/eg_bg_desert.jpg);'èæ¯å¾
background-position: center center ; 'å± ä¸
background-repeat:no-repeat;'å¾çä¸éå¤
}
</style>
</head>
<body>
</body>
</html>
温馨提示:答案为网友推荐,仅供参考
第1个回答 2016-11-08
纯粹的背景图居中,不考虑是否填满区域的话,可以用background-position:center center;
考虑到要填满整个区域,可以使用background-size:cover本回答被网友采纳
考虑到要填满整个区域,可以使用background-size:cover本回答被网友采纳
第2个回答 2016-11-08
background-size:cover;