0

我有一种情况,我有一个宽度为 840 像素的包装 div。
现在,在该 div 中,我放置了一个不那么重要的装饰元素 (#dekoschrift),它与包装 div 重叠。我不希望从该元素触发水平滚动条。

大致情况如下:

<div class="centerer">
    <div id="wrapper">
          <div id="dekoschrift"></div>
    </div>
</div>

的CSS:

.centerer { position: relative; width: 830px; margin: 0 auto; height: 100%; }
#wrapper { position: relative; float: left; width: 100%; height: 100%; }
#dekoschrift { 
      background:  url(/images/layout/Variaton_Typogrund.png) no-repeat 0 0 transparent; 
      width: 238px; height: 524px; 
      position: absolute; top: 280px; left: 845px; z-index: 0; 
    }

这有可能吗?

我试图将“溢出:隐藏”设置为包装器 div,但这显然是图形。而且我不能在 body 上使用“overflow-x:hidden”,因为这会导致无法在小屏幕上滚动。

这是实际页面的链接:www.variaton.ch

任何帮助表示赞赏!
也许有一些我不知道的秘密“显示:秘密”参数?!

干杯
斯特凡

4

3 回答 3

0

使用媒体查询。您可以禁用不需要滚动的显示的滚动,然后在强制时弹出滚动条。

body {
    overflow-x : hidden;
}

@media all and (max-width: 1024px) {
    body {
        overflow-x : auto;
    }
}
于 2013-01-30T21:44:57.710 回答
0

尝试

.dekoschrift
{
visibility:hidden;
}
于 2013-01-30T21:48:26.563 回答
0

所以最终的代码是这样的:

   @media all and (min-width: 840px) {
        body {
            overflow-x : hidden;
        }
    }

    @media all and (max-width: 840px) {
        body {
            overflow-x : auto;
        }
    }

谢谢 Alienwebguy

于 2013-01-31T10:35:21.007 回答