当里面有很多内容时,如何让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 scroll 会是更好的解决方案吗?或者您会使用 css 显示所有内容吗?
最佳答案
关于jquery - 根据内容溢出展开div或UL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10914796/