【问题标题】:Firefox doesn't show vertical scroll bar when height is too short高度太短时 Firefox 不显示垂直滚动条
【发布时间】:2015-06-12 09:58:47
【问题描述】:

我尝试在 DIV 上设置一个垂直滚动条以缩短高度。 它适用于 Chrome 和 IE 10(没有尝试其他)。 但是高度太短时,Firefox 不显示垂直滚动条。

有没有办法让Firefox即使高度很短也显示垂直滚动条?

div.title{
	position: absolute; 
	top: 0px; 
	height: 97px;	
	width:100%;
}

body{		
	margin: 0;   
}

div.tableHeader{	
	position: absolute; 
	top: 98px; 
	height: 28px;		
	overflow-y: scroll;
	width:100%;
}
		
    <body>

		<div class="title">
        	<h1> Demo how to set vertical scroll bar</h1>        	
        </div>        
		<div class="tableHeader">
			<b>test vertical scroll bar, please check right side vertical scroll bar</b>
        </div>


    </body>

【问题讨论】:

标签: css firefox height vertical-scrolling


【解决方案1】:

滚动条也会出现在 Firefox 中,如果您想查看“可拖动条”,请尝试类似...

    box-sizing: border-box;
    padding: 6px 0;

..增加内部内容的高度。

div.tableHeader{	
	position: absolute; 
	top: 98px; 
	height: 28px;		
	overflow-y: scroll;
	width:100%;
	box-sizing: border-box;
	padding: 8px 0;
}
		
    <body>

		<div class="tableHeader">
		  <b>test vertical scroll bar, please check right side vertical scroll bar</b>
		</div>

		</body>

【讨论】:

    猜你喜欢
    • 2014-12-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多