/    Sign up×
Community /Pin to ProfileBookmark

IE not accomodating for size of expanding absolute div

I have a site that has an absolutely positioned nav menu div. Each item in the div can be clicked on to show its subitems. The problem I am having is that if I go and open all of the main items in the div to show their corresponding subitems, in IE, the viewport is not correctly resizing itself to show all of the options. A scroll bar will appear for the body, but when you scroll to the bottom, you lose the bottom part of the menu (meaning it is not scrolling enough to show all of the menu). I don’t have this problem in FF or NN, where the last item in the nav menu is at the very bottom of the viewport, which is what I would expect.

Has anyone ever encountered a similar problem? Does anyone have any suggestions for correcting this?

My layout is as follows:

[CODE]
<html>
<body>
<div id=”header” />
<div id=”subHeaderWrapper”>
<div id=”subHeader”>
<div id=”userLoggedIn” />
<div id=”currentLocation” />
</div>
<div id=”statusMsg” />
<div id=”mainNavMenu”>
<div class=”mainMenuItem”>
<div id=”xxx_subHeader” class=”submenuDiv”>
<div class=”submenuItem” />
</div>
</div>
<!– mainMenuItem div repeats for all of the top level menu items –>
</div>
</div>
<div id=”content”>
<div id=”contentBottom” />
</div>
</body>
</html>
[/CODE]

And the relevant CSS is:

[CODE]
html, body { margin: 0; padding :0; }
#header { position: relative; height: 91px; }
div#content { margin-left: 176px; padding-left: 5px; padding-right: 5px border-left: 2px solid black; }
div#subHeaderWrapper { position: relative; }
div#subHeader { position: relative; border-bottom: 3px solid black; border-top: 1px solid black; height: 25px; }
div#subHeader div#userLoggedIn { position: absolute; top: 20%; left: 0; margin-left: 0.35em; }
div#subHeader div#currentLocation { position absolute; top: 20%; right: 0; margin-right: 1em; }
div#mainNavMenu { position: absolute; top: 0; width: 175px; margin: 26px 0 0; border: 1px solid black; border-top: 1px solid black; border-right: 2px solid black;}
[/CODE]

Any help is greatly appreciated!

to post a comment
CSS

3 Comments(s)

Copy linkTweet thisAlerts:
@drhowarddrfineApr 13.2006 — I can't get any of that to work right.


You will never get IE to display like modern browsers without a proper doctype.


In HTML, there is no such thing as a tag ending as />. That is xhtml and is used to [B]close[/B] a tag.

So, close your divs with </div>
Copy linkTweet thisAlerts:
@WebJoelApr 14.2006 — I can't figure out why in your *css you have several "position:relative" selectors with no declaration(s) to make it do anything. The only other use for "position:relative" without a "top:#px; bottom:#px;" would be to get proper control on a "z-index:#;" declaration in IE under some circumstances.

Ending a DIV with "/>" oddly enough seems it [I]might[/I] work, at least without a !doctype, but that is essentially ending the DIV before taking any action to it's contents so maybe not. I suppose that a Div like [B]<div style="clear:all; width:100%; height:1%;" />[/B] would be as valid as [B]<div style="clear:all; width:100%; height:1%;"></div>[/B] (used here only clear a previous float (and a 1% vertical spacer, for whatever reason), perhaps?, with nothing contained within this DIV, of course.

I'm interested to see what others more proficient in css have to add. ?

I noticed in the css part:
[CODE][COLOR=Red]border: 1px solid black;[/COLOR] [B]border-top: 1px solid black; border-right: 2px solid black;[/B][/CODE]
Note that the BOLD text, it works, but is redundant because the [COLOR=Red]RED[/COLOR] selector/declaration has already defined everything you need to have a 2px solid black border on all four sides of this DIV anyway.

If you don't believe me, take out [COLOR=Red]just the red text[/COLOR] and you'll have a 2px solid black border on the top and on the right only, on that DIV. "border:" means "all four sides". 'Nuff said. You don't need to then add "border-top" or "border-right" (unless they are different, but then you've got selectors & declarations doing/undoing things to each other... unnecessary and over-complicated. ?

And upon having said all of this, if this is a 'navigation menu', I'd do it with <ul><li> etc... It would be a lot simpler and probably easier to understand/edit/style.
Copy linkTweet thisAlerts:
@wood_tahauthorApr 14.2006 — Thanks for the replies. I should have stated that I did not post the complete code, I was just posting the layout to try and give you a feel for what my structure was like. I actually have content in the divs, but b/c I am pretty confident that it didn't have any effect on what was giving me trouble, I didn't include it.

The position:relatives are used b/c I have abosultely positioned items within them and I was defining the container that the absolutely positioned elements will be positioned.

The duplicate border declaration was just an error on my part. I had to re-type all of the code for proprietary reasons, and also b/c I don't have an internet connection from the computer I am doing my coding on. Because of my re-typing, I left some things out (only things that I am sure have no effect on my problem).

Having said all of that, and looking at the basic structure of what has been posted, can anyone notice anything that would give them any idea why I am having my trouble? Does anyone know of any known issues about IE and not accomodating expanding content that is absolutely positioned?

If I have to, and can try and re-create a working example, but it will take me some time ...
×

Success!

Help @wood_tah 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 5.19,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...