身体背景图像位置问题在CSS

时间:2013-06-05 08:44:20

标签: css background background-image background-position

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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 {
    margin: 0px; padding:0;
    background:url(http://custdemos.com/synverse_portfolio/images/safercab_mobi.png) no-repeat left bottom;
    height:100%
}
</style>
</head>

<body>
<div class="do">
X Content 
</div>
</body>

</html>

我需要把背景图片放在身体底部,如果有人知道这个问题请告诉我。

1 个答案:

答案 0 :(得分:0)

你需要给身体一个最小高度。这是更正后的jsFiddle link。以下也是修改过的css

body {
    margin: 0px;
    padding:0;
    background:url(http://custdemos.com/synverse_portfolio/images/safercab_mobi.png) no-repeat left bottom;
    min-height:500px;
}