English 中文(简体)
如何将 div 附加到另一个的底部, 以便内容可以滚动
原标题:How to attach a div to the bottom of the other so that the content is scrollable
  • 时间:2012-05-24 21:32:34
  •  标签:
  • html
  • css

OK,所以基本上我有:

<div style="overflow-x:scroll">
    <div class="content">
        <div class="text"></div>
        <div class="seperator"></div>
    </div>
</div>

我想在内容 div 的底部定位底部的 div( 它基本上是一种水平线)

我尝试了 < code> 位置: 绝对 嵌入 < code> 位置: 相对 div 标签, 但因为顶部的 div 是可滚动的, 当我滚动时, 静脉保持固定

我要如何完成这项工作( 我必须使用 < code> class=content div 中的分隔器, 以免破坏我为它设定的背景)?

编辑:好了,所以我的静音器有一些阴影和东西 所以我需要它来覆盖内容, 所以我需要某种绝对定位, 而不是对页面, 到最上面的Div

有没有办法相对地定位它 所以它总是在母传奇的底部?

最佳回答
#top-div { position:relative; /* fixed height or width */ }
#bot-div { position:absolute; bottom:0 }
问题回答

更改此更改 :

.sep {
 border-bottom: 4px solid rgba(0,0,0,0.5)   
 position: absolute;
    bottom: 0;
}​

为此:

.sep {
 border-bottom: 4px solid rgba(0,0,0,0.5);
}​

如果我不明白你的问题 请随意纠正我





相关问题
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!

热门标签