PDA

View Full Version : scrolling inside a box


Agent007
12-01-2006, 03:25 AM
if you take a look at the home page of my site, www.faceofrochester.com/, in the main box of the template where it says "Home" on the left...how can I put a scroll bar in that box so that when long content is entered the whole page stays the same size and in the center, with the red background, and you scroll inside of that box instead of scrolling down some ugly 800x4,000px page that isnt the same size as the other pages with less than a page worth of content.

edbr
12-01-2006, 03:38 AM
Place a layer set the size and add overflow scroll a simple example below



#Layer1 {
position:absolute;
width:200px;
height:115px;
z-index:1;
overflow: scroll;
}

domedia
12-01-2006, 12:55 PM
You can read our article as well by Ranjan, CSS Scroller:
http://www.dreamweaverclub.com/css-scroller.php

Agent007
12-01-2006, 05:19 PM
http://www.faceofrochester.com/events.html

that made it look so much better, EXCEPT....how do I center the layer? The layers position is absolute and my site is centered with tables and divs. When the browser window is resized, the site centers itself, but the events scroll remains static.

Agent007
12-03-2006, 11:46 PM
Solved. If anyones wondering, you make the position "relative" in the CSS styles.

chriskq
12-04-2006, 03:58 AM
Agent007, yes congratulations... you just learnt a css rule.

if you have a container (a div or a table) that is positioned absolute, anything you put inside it has to be positioned relative to make it stay within its boundaries.

good work on finding out for yourself