开发者

Div Background Image

开发者 https://www.devze.com 2022-12-31 11:03 出处:网络
i just wanted to put the bgbottom to the bottom part of my body.What happens the bottom image is until the end of footer and didn\'t go beyond to the bottom of the body.

i just wanted to put the bgbottom to the bottom part of my body.What happens the bottom image is until the end of footer and didn't go beyond to the bottom of the body.

#bgtop {
    background-image:url(images/bgtop.png);
    background-repeat: repeat-x;
}

#bgbottom { background:url(images/bgbottom.png) repeat-x bottom;}

HTML

开发者_StackOverflow社区
<body>
<div id="bgtop"></div>
<div id="bgbottom"></div>


While your question isn't clear, I think you're looking to fix an image across the bottom of your page. If this is the case, use the CSS property background-attachment: fixed

After re-reading your question a bit more, I think you may be trying to just get your height to be 100% of the page (again, not really sure)? If this is the case, you can set height: 100% or you can apply the background image to the <body> tag itself:

body { background: #[color] url([image]) repeat-x left bottom; }


If the 100% height for the body tag does not work, then position the bottom div. Set the bottom div position property to fixed and set bottom to -1px and left to 0px. This will ensure the background image flows out of the bottom of the browser window. I think this is a solution to your problem.

#bgbottom { background:url(images/bgbottom.png) repeat-x; position:fixed; bottom:-1px; left:0px;}
0

精彩评论

暂无评论...
验证码 换一张
取 消