出身背景
我有一个固定宽度和高度的不可滚动div。
这里有一个JSFiddle:
https://jsfiddle.net/Naibaf/47fm4pvf/2/
球门
如果不是前一个字符串,我想显示尽可能多的底部字符串。
推理和问题
你应该问自己:为什么?我正在尝试显示
news-alert-like-bar
,但我将div的内容与
setInterval()
这会使它很快溢出。
依我看,jQuery
.scrollTop()
比如这里:
http://jsfiddle.net/2WpQf/1/
不适合,因为我希望我的div不可滚动。CSS也是如此
overflow
.
有人知道怎么做吗?
HTML格式
<p>How to make the bottom of a string visible within the boundaries of a div and NOT show or hide the top part?</p>
<p>The opposite of what I want:
</p>
<div class="hidden">You can use the overflow property when you want to have better control of the layout. The default value is visible.</div>
CSS公司
div.hidden {
background-color: #00FF00;
width: 100px;
height: 100px;
overflow: hidden;
}