David Posted April 10, 2006 Report Share Posted April 10, 2006 Ive always been a little confused about how to get a scrollable text area on a layout. I dont want to use an I-frame, I just want the text to overlay the background and be scrollable. Is this possible?? Im pretty sure you cant use a scroll bar in a table.Not too sure how clear that was?Thanks,Dave Quote Link to comment Share on other sites More sharing options...
Danny Posted April 10, 2006 Report Share Posted April 10, 2006 You can do it by giving the area a fixed height and width then using id or class refer it to a style withoverflow: scroll;e.g.<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Meh</title><style type="text/css">#box { width: 400px; height: 200px; overflow: scroll;}</style></head><body><div id="box">La la la la la</div></body></html>[/code] Quote Link to comment Share on other sites More sharing options...
Simon Posted April 10, 2006 Report Share Posted April 10, 2006 Make a div <div> Content </div> Give it an id or class. Use id if you are only going to use it once, or a class if you are going to use it many times. <div class="scrollable"> Content </div> Then do the CSS, either inline or externally. .scrollable { width:400px; height:400px; overflow:auto; } The "overflow:auto;" is the important bit, it makes a scrollbar appear if the content of the div is higher then 400 or wider then 400.Also try "overflow:scroll;" if auto doesn't produce the desired output.And Danny is also gay. Quote Link to comment Share on other sites More sharing options...
David Posted April 10, 2006 Author Report Share Posted April 10, 2006 Thankyou both Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.