2012-04-26 2 views
-2

divボックス内に長いメッセージがあり、div内にそのテキストメッセージをスクロールバー(垂直)で表示する方法を探しています。リンクが2つありますあなたが見ることができるように: 1)免責事項 2)動作 上記のリンクはハイパーリンクですので、それらのリンクをクリックすると、選択に基づいて以下のdivが表示されます。素敵なモデルのdivなどとハイパーリンクの下にdivを表示することは可能ですか?あなたは、スクロールバーをしたい場合はdiv内の長いテキストメッセージを作成する方法

のdivボックスが素晴らしい見えるように可能であれば私はCSSの男ではないよ:)

<span ><a href="#" >Disclaimer-1</a></span> <span class="slide1"> 
     &nbsp; &nbsp; | &nbsp; &nbsp; <a href="#" class="slide1">Behavior</a></span> 
    <div id="one" > 
     Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s 
    </div> 
    <div id="second" > 
      Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s  
    </div> 
+1

お困りですか? –

+0

あなたはどういう意味ですか:そしてdivをクリックすると、リンクの下にdivが必要になります。 – Daveo

+0

私は自分の質問を更新しました。ごめんなさい。 –

答えて

1

は、overflowautoまたはscrollを行い、その後heightを設定します。

div#one, 
div#two 
{ 
    height: 120px; 
    overflow: auto; 
} 

最新の編集については、JavaScriptを使用してそのようなものを実装しています。

+1

高さを設定することを意味しますか?彼は垂直スクロールバーを望んでいるので、高さを制限する必要があります。またはdivが伸びます。 –

+0

@SurrealDreamsええと、私は実際のサンプルコードで見ただけの高さを意味していました。P – Marty

+0

私たちは皆同じページにいることを確認しました。 :) –

0

こんにちは、スクロールバーを左側にして、ページをフォーマットしてください。使用できる基本的なCSSを見つけてください。

<style type="text/css"> 
     #one{ 
      overflow-y: scroll; 
      padding: 15px; 
      height: 150px; 
      line-height: 25px; 
      margin: 20px 0px 20px 0px; 
     } 
     #second{ 
      overflow-y: scroll; 
      padding: 15px; 
      height: 150px; 
      line-height: 25px; 
     } 
     span a{ 
     padding-left:15px; 
     color:blue; 
     text-decoration: none; 
     } 
     span a:hover{ 
     padding-left:15px; 
     color:blue; 
     text-decoration: none; 
     } 

    </style> 

ポイントwhen i click on the div i just need the div to be underneath the linksを指定してください。

ありがとう..

関連する問題