English 中文(简体)
差异扩大了过去一页的高度,但没有滚动条
原标题:Div expands past page height, but no scroll bar
  • 时间:2011-07-14 15:40:25
  •  标签:
  • html
  • css

我的导航网页有一页。 Clicking on the ́s a subset. 我有这个四舍五入到100%的顶峰,这样一栏就能够建立<>>。 问题发生在所有分区。 ∗ 原文照发。

I tried setting the height to auto to see if that would fix the problem (ignoring the fact that it doesn t take up the whole left side), but that didn t fix it either.

因此,当四舍五入上页高峰时,我需要做些什么才能获得滚动酒吧? 那么,如果不需要的话,则 s吧就会消失。

谢谢。

.leftNavigation {
display:block;
position:fixed;
width:200px;
height:100%;
top:140px;
left:0;
background-color:#f0f0f0;

iii

<div class="leftNavigation">
    <p class="linkHeader" id="townLinksHeader"><img src="img/image.jpg" width="200" height="40" alt="Sunnyvale, CA" /></p>
    <div class="links" id="townLinks">
        <ul>
            <li><a href="">Link</a></li>
                    <li><a href="">Link</a></li>
                    <li><a href="">Link</a></li>
                    <li><a href="">Link</a></li>
        </ul>
    </div>

There are 4 paragraph/div combinations inside the left navigation div. Only the paragraph is show until it is clicked on. The links div is then show. When each of those is expanded, it runs off the bottom of the page but doesn t add a scroll bar.

增加超支:auto没有变化。

最佳回答

Does the side content div use fixed positioning? Because, that is usually why a scrollbar does not appear. Try setting the overflow:auto css style on that div to add a scrollbar when needed.

<>Update:

你的顶点是:那里140px和高点:100%。 这实际上使一边倒在网页上。 如果可扩展的内容没有占用大量空间,那么它就会从网页底部走,不会出现滚动。

为此:

.leftNavigation {
    display:block;
    position:fixed;
    width:200px;
    height:100%;
    top:0;
    left:0;
    padding-top:140px;
    overflow:auto;
    background-color:#f0f0f0;
}
问题回答

在固定位置时,不会增加滚动条。 您可尝试将其定位为<代码>:相对,或可设置<代码>top:0。 如果最高点:0 仍然不足,你必须把高点推到低于你的窗口的固定高度。

.leftNavigation {
    display:block;
    position:fixed;
    width:200px;
    height:100%;
    top:0;
    bottom:0;
    left:0;
    margin-top: 140px;
    overflow:auto;
    background-color:#f0f0f0;
}

现在情况是正确的。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签