Question:

How do you put scroll bars on regular text?

by  |  earlier

0 LIKES UnLike

I was wondering how you put scroll bars on regular text because i would like to add it to my page, so you don't have to scroll bar all the way down. And So it doesn't take up most of the page! Could any help me? :) thanks!

 Tags:

   Report

2 ANSWERS


  1. If you mean you want to create a fixed-size DIV that employs scrollbars when neeeded:

    <div style="width:500px; height: 300px; overflow: auto;">

    Scroll bars will appear if this box is more than 500px wide or 300 px tall as a result of whatever it contains.

    </div>


  2. <div style="width:100px; height:100px; overflow-y:auto;">

    sample text<br/>sample text<br/>sample text<br/>sample text<br/>

    sample text<br/>sample text<br/>sample text<br/>sample text<br/>

    sample text<br/>sample text<br/>sample text<br/>sample text<br/>

    </div>

    the style makes this div do what you want.

    width and height give the dimensions of the box.

    overflow-x:auto; makes the scroll bar appear on the side of the box if the text does not fit inside the dimensions.

    overflow:auto will make the side and bottom scroll bars appear.

    overflow-y:auto will make only the bottom one show up.

    I like overflow-x so user does not have to scroll two ways..

    sample text is where all your normal text would go.

    Enjoy :D

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.