please see - if you see the about.htm page, I want to move the scroller upwards until it touches the horizontal menu above it. What is the best way to do this keeping all other items on the page as they are (i.e - spaces should be there around the middle part of the page. also - is it okay if i upload files on rapidshare and give the link in this way?

Dani AI

Generated

Short answer for : you cannot move the browser window scrollbar itself (as already pointed out). Two practical ways to get the visual effect you want are: 1) remove/shift the top gap so the page content starts directly under the menu, or 2) create an inner scrollable content area that begins at the bottom of the menu so its scrollbar sits against the menu.

A simple pattern that often fixes this is to wrap the main content in a positioned container and give it its own scrollbar. For example, put your table inside a #content element and anchor it under the menu with CSS so the wrapper, not the window, scrolls:

/* example — adjust nav height to match your menu */
#nav { height: 50px; }

#content {
  position: absolute;
  top: 50px;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: auto;
}

If cellspacing="20" is producing layout you want elsewhere, remove the attribute and use CSS instead (either td { padding: 20px; } or table { border-spacing: 20px; border-collapse: separate; }) so you can set the top wrapper independently without disturbing inner spacing. Also check default margins on body and headings and your DOCTYPE (quirks mode can change table behavior). For reference, MDN has concise docs on overflow and border-spacing if you want details: overflow on MDN and border-spacing on MDN.

If you can paste a minimal HTML/CSS snippet here (just the menu and the table) someone can give a line-by-line tweak.

Recommended Answers

All 3 Replies

What scroller? The only scroller I see is the one at the right of the page.

yes, thats the one i want to move uo until it touches the horizontal menu above it. if you see the code, you will see thats its difficult to do directly because of the cellspacing="20" of the table. if you set cellspacing="0", everything gets misaligned (that is the small images and text in the middle of the page). i only want to move the scroller up and leave everything else exactly the way it is.

I don't think we are seeing the same thing. All I see is the scrollbar that belongs to the browser window.

The scrollbar at the right edge of the window belongs to the browser, not to your page. You can't change it.

Are you trying to move the menu bar to the top of the page?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.