2

内部に多くのコンテンツがある場合、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 を使用してすべてを表示しますか?

4

3 に答える 3

2

ユーザーにボタンをクリックしてもらいたいと仮定して、jquery を使用します。

http://jsfiddle.net/nvCvy/2/

于 2012-06-06T13:11:30.560 に答える