开始滚动后切断背景?

时间:2013-11-11 06:20:25

标签: html css

您可以在此处查看我遇到问题的页面:http://www.easythemepro.com/themes.php

由于某种原因,背景被切断了大约一半。我将它设置为100%高度,但这似乎不起作用......

body {
    font-family: sans-serif;
    font-size: 12px;
    line-height: 1.4em;
    width: 100%;
    background: #D5D5D5;
    height: 100%
    box-shadow:0 0 40px rgba(0, 0, 0, 0.4) inset;
    overflow: auto;
}

我不确定我在这里做错了什么......它看起来应该对我有用。

3 个答案:

答案 0 :(得分:0)

那是因为你正在用css创建bg,如果你不打算使用javascript,你可能需要使用图片并使用background-attachment:fixed;

参考:http://www.w3schools.com/cssref/pr_background-attachment.asp

答案 1 :(得分:0)

我认为你想要对你的html有内在的影子,你也不需要为你的身体背景设置那么多样式。我发现您使用1x1图片作为背景,您可以使用#D5D5D5代替该图片。这不需要backgrond-positionbackground-repeat使用此CSS:

html{
    box-shadow:0 0 40px rgba(0, 0, 0, 0.4) inset;
    /* other styles if you have */
}

body{
    background:#d5d5d5;
    /* and remove other background styles */
}

答案 2 :(得分:0)

body,html { {
{1}} {
{1}} {
{1}} {
{1}}
{{ 1}} {
{1}} {
{1}} {
{1}} {
{1}}