我的背景图片尺寸为1620*1080,而我的屏幕分辨率为1366*768。为什么右侧约15%的屏幕没有被覆盖呢?
这是我的代码:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
body {
min-height: 100%;
min-width: 100%;
background-image:url(background.png);
background-repeat: no-repeat;
}
div#container {
margin: 0 auto;
background-color: red;
}
</style>
</head>
<div id="container">
</div>
<body>
</body>
</html>
正如您所看到的,我已经添加了
标签。
min-height: 100%;
min-width: 100%;
想必这些对你有所帮助。而 background-repeat: no-repeat;
只是为了让它不覆盖整个屏幕。
有什么想法吗?谢谢!