2015-03-02 245 views
0

我想构建一个页面,其中页面中间的某个DIV元素是可水平滚动的(大宽度+ overflow-x: scroll)。滚动条将出现在这个DIV的底部。水平滚动+滚动条

是否可以在页面最底部显示一个滚动条(所以不在div底部),它只滚动页面中间那个可滚动的DIV中的内容?

我问这个问题,因为我想将内容放置在可滚动的DIV下面,我希望用户能够通过位于此内容下的滚动条滚动水平线DIV

<body> 
<div id="wrap"> 

    <div class="slider"> 
     # Slider content here 
    </div> 

    <ul class="job_listings scrollable"> 
     <li>job 1</li> 
     <li>job 2</li> 
     <li>job 3</li> 
     <li>job 4</li> 
    </ul> 

    <div class="about us"> 
     # About us content here 
    </div> 

    ** here I want the scrollbar of the ul job_listings to appear, at the very bottom of the page ** 

</div> 
</body> 
+0

能否请您分享的HTML,以及你想什么呢? – 2015-03-02 12:56:53

+0

更多信息请 – Lafontein 2015-03-02 13:07:13

+0

我添加了我的html代码示例 – 2015-03-02 13:11:00

回答

1

您可以通过添加position: fixed;到非滚动内容来实现这一目标。

.slider { 
    position: fixed; 
    top: 0; // Assuming you want this to be on top 
} 
.about_us { 
    position: fixed; 
    bottom: 0; // Assuming you want this to be on the bottom 
} 

JSFiddle demo

+0

谢谢,我认为这是布置页面的唯一可能的解决方案。 – 2015-03-02 15:29:57

0

使用padding-bottom:180px像我一样在这里http://jsfiddle.net/v6ohjw32/ 和删除border:2px solid green;消除边界

+0

我相信他希望滚动条位于页面最底部和全角,就像本地浏览器滚动条一样。 – 2015-03-02 14:02:15

+0

这是真的,它需要在最底部 – 2015-03-02 14:10:43

+0

您可以根据您的需要增加填充底部大小 – YourFriend 2015-03-02 14:12:10