我有这段CSS代码:
<style>
body {
position:absolute;
background-image: url(art/c11.jpg);
width:100%;
height:100%;
}
</style>
根据我在网络上的阅读,我预期这将调整背景图像并适应浏览器窗口大小。
但是没有。我认为我显然做错了什么(我不太懂CSS)。有什么提示吗?
更新:
我添加了整个示例(不起作用):
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>No Title</title>
<style type="text/css">
body {
position:absolute;
background-image:url(art/c11.jpg);
background-size:100%;
background-repeat: no-repeat;
width:100%;
height:100%;
}
</style>
</head>
<body >
</body>
</html>