/    Sign up×
Community /Pin to ProfileBookmark

developing for IE 6 – fixed position

I’ll start with my code.

[code]<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>Untitled Document</title>
<style type=”text/css”>
body {
height: 100%;
width: 100%;
overflow: hidden;
margin: 0px;
padding: 0px;
}
#menu {
position: absolute;
display:block;
bottom:0px;
left:0px;
width:100%;
border:1px solid #002E80;
background-color: #E5EFFF;
}
#content{
padding: 5px;
width: 100%;
height: 100%;
overflow: auto;
z-index: 100;
}
</style>
</head>
<body>
<div id=”content”>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
</div>
<div id=”menu”>
<table width=”100%” border=”0″>
<tr>
<td><div align=”left”>
<input type=”button” name=”prevBut” value=”<< Prev” />
</div></td>
<td><div align=”right”>
<input type=”button” name=”nextBut” value=”Next >>” />
</div></td>
</tr>
</table>
</div>
</body>
</html>
[/code]

The problem falls on the positioning of the scrollbar. I need it to be over my bottom menu. Right now it falls below the menu. Why is this?

to post a comment
CSS

6 Comments(s)

Copy linkTweet thisAlerts:
@FangJul 27.2004 — You have [I]overflow: hidden;[/I] in body which hides the body's scrollbar.

The scrollbar you see is from the content.

Adding [I]margin-bottom:2em;[/I] to body will bring the scrollbar up above the menu.

If you change the menu contents you will have to re-adjust [I]margin-bottom[/I].

BTY all the [I]height: 100%; and width: 100%;[/I] is probably unnecessary.

Using the XML prolog puts IE into "quirks" mode which allows the "fixed" effect to work, it may also give you problems later with the box model in x-browser layout.
Copy linkTweet thisAlerts:
@binkybooauthorJul 27.2004 — I'm using overflow:hidden in the body tag so that I don't have two scrollers. I'm trying to create a bottom frame effect. I only want the content to scroll.
Copy linkTweet thisAlerts:
@davidbrentJul 27.2004 — Well how about only defining overflow for the bottom bar rather than the whole page.
Copy linkTweet thisAlerts:
@binkybooauthorJul 27.2004 — Thanks for the responses!

Unfortunately I tried that earlier with no success. I feel like I'm very close. All I need is for the content scroller to appear above the bottom menu. I've come to realize that accomplishing this task is easier said than done.
Copy linkTweet thisAlerts:
@FangJul 28.2004 — What's the problem with this?
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;style type="text/css"&gt;
body {
height: 100%;
width: 100%;
overflow: hidden;
margin: 0px;
padding: 0px;
margin-bottom:2em;
}
#menu {
position: absolute;
display:block;
bottom:0px;
left:0px;
width:100%;
border:1px solid #002E80;
background-color: #E5EFFF;
}
#content{
padding: 5px;
width: 100%;
height: 100%;
overflow: auto;
z-index: 100;
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id="content"&gt;
content here
&lt;/div&gt;
&lt;div id="menu"&gt;
&lt;table width="100%" border="0"&gt;
&lt;tr&gt;
&lt;td&gt;&lt;div align="left"&gt;
&lt;input type="button" name="prevBut" value="&lt;&lt; Prev" /&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;td&gt;&lt;div align="right"&gt;
&lt;input type="button" name="nextBut" value="Next &gt;&gt;" /&gt;
&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
Copy linkTweet thisAlerts:
@binkybooauthorJul 28.2004 — Wow, I must have been at this too long. That's exactly what I need. Thanks a bunch!
×

Success!

Help @binkyboo spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...