当其中有很多内容时,如何使 div 扩展?
HTML:
<div class ="content">
this is a test <br />
this is a test <br />
this is a test <br />
this is a test <br />
this is a test <br />
this is a test <br />
this is a test <br />
</div><br />
<div class="click-here">Click here to see more</div>
CSS:
div.content
{
height:100px;
width:300px;
border:1px solid red;
overflow:hidden;
}
div.click-here
{
border:1px solid green;
width:200px;
}
这是我的例子:http: //jsfiddle.net/nvCvy/1/
jQuery 还是 CSS?
jquery 滚动会是更好的解决方案吗?还是您会使用 CSS 显示所有内容?