Forum Moderators: not2easy

Message Too Old, No Replies

Small problem with Netscape Positioning

Positioning works in IE but not in NN

         

kokeefe

4:29 pm on Jul 15, 2004 (gmt 0)

10+ Year Member



I have a small problem. I'm testing my site, and everything is positioned right in NN 7.1, but the navigation menu is on the far left. I don't know why.

Here is my code:

#linkList {
position: absolute;
margin: 0px 0px 0px 25px;
top: 225px;
width: 242px;
z-index: 1;
}

I know something is probobly wrong but I don't know what it might be. Why can't all browsers get along? Someone give me a clue!

Ryan8720

2:14 am on Jul 16, 2004 (gmt 0)

10+ Year Member



I don't understand what you are trying to do. Right now it is set to be 25px from the left of the containing box. Why aren't you using the left: 25px;?

kokeefe

1:55 pm on Jul 16, 2004 (gmt 0)

10+ Year Member



Even when I use left: 25px; I have the exact same problem.

createErrorMsg

2:05 pm on Jul 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Does the containing box have a position: relative; or position: absolute;?

kokeefe

2:19 pm on Jul 16, 2004 (gmt 0)

10+ Year Member



body {
margin: 0px;
padding: 0px;
background-color: #ffffff;
font-size: 12px;
color: #333333;
font-family: arial, helvetica, sans-serif;
text-align: center;
background-image: url(images/theme2background.jpg);
background-position: center;
background-repeat: repeat-y;
}

#container {
background: transparent url(images/theme2.jpg) no-repeat top center;
margin: 0px;
padding: 0px;
width: 852px;
text-align: left;
height: 900px;
}

DrDoc

3:12 pm on Jul 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



you need this in your #container:

margin: 0 auto;
position: relative;

kokeefe

3:21 pm on Jul 16, 2004 (gmt 0)

10+ Year Member



That did nothing. Netscape still wants to move my menu (that is absolutely placed) to the far left;

createErrorMsg

3:50 pm on Jul 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If the menu you speak of is located inside the #container <div> it is probably not positioning right because the #container div is not, itself, a positioned element.

Absolutely position elements must be inside of positioned elements (absolute or relative), otherwise their offset is determined by the next container out (frequently the HTML tag).

So, if you add position:relative to the #container div, it should allow the absolutely positioned menu to position properly.

<self-edit>just noticed that Doc already told you this. :) </self-edit>

mcavill

3:53 pm on Jul 16, 2004 (gmt 0)

10+ Year Member



a quick check of the user agent - if it's not google or an IE browser, redirect to the M$ download page - I find it halves my testing time ;)

createErrorMsg

3:55 pm on Jul 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Wait...did you try adding position:relative to the #container and adding the left: 25px to the #menu at the same time?

kokeefe

7:05 pm on Jul 16, 2004 (gmt 0)

10+ Year Member



Yep. Did all that and still the damn menu is on the far left. I don't know what to do.