jezjsa — 2011-12-06T05:00:22-05:00 — #1
i wondered if anyone could help.
I'm trying to find a tutorial whereby on a page the top div and right div remain in the same position on the screen, and the left div can scroll up and down with the browser scroll.
I found the example below but that is for keeping 1 div in the same position. Anyone know how to apply the same thing to a second div?
Any help would be great.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<div class="top">keep in same position</div>
<div class="left">content can scroll with the page</div>
<div class="right">keep in same position</div>
chris_upjohn — 2011-12-06T05:50:22-05:00 — #2
You don't even need JS for this, you can simply apply position: fixed to the selector instead of position: absolute and it will stay in a fixed position on the page.
jezjsa — 2011-12-06T06:04:34-05:00 — #3
does that work in all browsers? thanks for the reply though
chris_upjohn — 2011-12-06T06:49:21-05:00 — #4
It doesn't work in IE6 but as a fellow web developer i don't support IE6 anymore unless a client specifies it, there are plenty of reasons why not to support it anymore but the main reason can be found at http://www.ie6countdown.com/