我有一个尺寸为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;
只是因为它不覆盖屏幕。
任何想法?谢谢!
为什么你身上的标签之外一个div? – stark
副本错误... – Yotam