两列主题,帮助,使两列分别可滚动

发布于 2024-08-31 12:13:48 字数 601 浏览 3 评论 0原文

我不知道该怎么做,我不是一名程序员,但尝试学习 CSS,因为这就是我使用的主题的编码方式。

我自己已经取得了很大的进展,但这一个很难我它的两列主题...据我所知,我可以使用以下内容:

#left {
   width: 235px;
   padding: 10px;
   margin-left: 20px;
   position: fixed;
   line-height: 15px;

如果我将位置更改为绝对,则整个页面滚动,如果我将其保留为固定,然后添加一个Twitter feed,或者其他类型的文本,它们让我过去了你通常会滚动的阅读内容,它被切断了,无法到达它,突出显示或滚动。

我也曾考虑过将主题更改为3 栏主题,但同样,不是程序员,我会很困惑。任何帮助都会很棒...

我的网站位于 99lessoxygen.tumblr.com,代码是从 http://nigredotheme 找到的。 tumblr.com


我要注意的是,如果它是固定的,则只有页面的右侧可以滚动,左侧被锁定。

I am not sure what to do on this one, I'm not a programmer, but trying to learn CSS as this is how the theme I am using was coded in.

I've gotten quite far on my own, but this one stumps me Its two column Theme... As far as I have been able to get, I can use the following:

#left {
   width: 235px;
   padding: 10px;
   margin-left: 20px;
   position: fixed;
   line-height: 15px;

If I change the position to Absolute, The whole page scrolls, If I leave it at Fixed, and add lets say, a Twitter feed, or other type of text that takes me past its reading where you would normally scroll, Its just cut off, cannot get to it, hightlight or scroll..

I've also toyed with the idea, of changing the theme to a 3 column theme, but Again, not a programmer, and i'd be really confused. any help would be great...

My Website is at 99lessoxygen.tumblr.com, code was found from http://nigredotheme.tumblr.com


I should note, that If its on Fixed, only the right side of page can be scrolled, and left side is locked..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

白昼 2024-09-07 12:13:48

我相信您要寻找的是 overflow:auto;

您需要删除 position:fixed

#box1 {
    height:100px;
    width:200px;
    float:left;
    overflow:auto;
}
#box2 {
    height:100px;
    width:200px;
    float:left;
    overflow:auto;
}

JSFiddle

positionabsolute 将继承绝对位置来自相对父级 div。

例如,如果您将 div 设置为 1000 像素并且相对位置
然后在该 div 中插入另一个 div,其位置为绝对位置,假设 right:100px 它将显示在父 div 的右侧,距离右侧 100 像素。

I believe what your looking for is overflow:auto;

You will need to remove position:fixed.

#box1 {
    height:100px;
    width:200px;
    float:left;
    overflow:auto;
}
#box2 {
    height:100px;
    width:200px;
    float:left;
    overflow:auto;
}

JSFiddle

A position of absolute will inherit an absolute position from the relative parent div.

So for instance if you have a div set to 1000 pixels and a position of relative
and then insert another div inside of that div with a position of absolute and lets say right:100px it will display on the right side of the parent div 100 pixels out from the right.

天涯离梦残月幽梦 2024-09-07 12:13:48

尝试给两列一个高度并添加以下内容:

overflow:auto;

如果内容溢出,这会使滚动条出现在其容器上。

try giving both columns a height and adding this:

overflow:auto;

This makes scrollbars appear on its container if the content overflows.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文