razzel
July 28, 2011, 10:35pm
1
Hi,
I have been following Russ Weaklys course Practical CSS and tried to create a main navigation with tabs. It works just fine for every browser except IE 7 and IE 6.
I have put the nav in the header and it is supposed to be at the very bottom of the header. In IE7 and 6 it will “jump” up maybe 10 pixels or so.
This is my CSS:
#header {
width:100%;
background-color:#000 ;
float:left;
position: relative;
}
This is the navigation:
.primary-nav{
background:#fff ;
}
.primary-nav li{
display:inline;
}
.primary-nav a{
float:left;
margin:0 2px 0 0;
background:white url(images/xxx.png) no-repeat left top;
text-decoration:none;
}
.primary-nav span{
padding:7px 15px;
display:block;
background: url(images/xxx.png) no-repeat right top;
}
Check out the attached images too se what I mean. I guess I need some CSS rule to make it work, but I cant figure out which one.
ralphm
July 28, 2011, 11:59pm
2
Hi razzel. Could you post your full CSS and HTML? There’s something missing in your CSS, as something must be pushing the nav down to the bottom of the header.
razzel
July 29, 2011, 6:16am
3
Hi and thanks for answering!
I want the nav to be at the bottom of the header. The problem is IE6, 7. They will show the nav a little bit up from the bottom.
razzel
July 29, 2011, 8:02am
4
ralphm
July 29, 2011, 10:54am
5
Looks like it might be the default margin on the UL. Try adding this to your style sheet:
.primary-nav {margin: 0; overflow: hidden;}
razzel
July 29, 2011, 11:05am
6
Thanks!
That fixed the problem for IE7, but IE 6 is still showing the same problem.
ralphm
July 29, 2011, 12:46pm
7
Cool. Could you update the page you linked to above?
ralphm
July 29, 2011, 1:59pm
9
Oops, sorry; my original code had a typo in it and I edited it, but incorrectly. It was meant to be this:
.primary-nav ul {margin: 0; overflow: hidden;}
Sorry.
razzel
July 29, 2011, 2:13pm
10
Oops, sorry; my original code had a typo in it and I edited it, but incorrectly. It was meant to be this:
.primary-nav ul {margin: 0; overflow: hidden;}
Sorry.
No problem. Changed it, but this really breaks the navigation. Maybe its the overflow that is causing the problem?
ralphm
July 29, 2011, 2:16pm
11
Ah, I forgot to mention to remove this:
.primary-nav {
background: none repeat scroll 0 0 #[COLOR="Red"]FFFFFF[/COLOR];
}
razzel
July 29, 2011, 2:20pm
12
Ah, I forgot to mention to remove this:
.primary-nav {
background: none repeat scroll 0 0 #[COLOR="Red"]FFFFFF[/COLOR];
}
Remove? Cant fint that in the css file.
ralphm
July 29, 2011, 2:23pm
13
It’s in style.css, line 43.
razzel
July 29, 2011, 2:27pm
14
This is what I find at line 43:
.primary-nav{
background:#fff ;
}
ralphm
July 29, 2011, 2:29pm
15
Ah, yes, sorry: Firefox was expanding it for me. OK, delete that line.
razzel
July 29, 2011, 2:30pm
16
Delete what? Now I am confused
ralphm
July 29, 2011, 2:33pm
17
Delete this from your CSS file:
.primary-nav{
background:#fff;
}
razzel
July 29, 2011, 3:03pm
18
Shouldnt make any difference? Its only a backgroundcolor. I tried the tip. Works on IE 7, not on IE 6 though.
ralphm
July 29, 2011, 3:15pm
19
It was needed on good browsers, as that bg color was messing things up.
I dunno about IE Sicks. Maybe see what happens by adding this to your style sheet:
* html #header {height: 150px;}
Or, if that doesn’t work, you could perhaps try
* html #header {display: inline;}
I’m not very good with IE6, and am so over that browser it’s not funny.
razzel
July 29, 2011, 3:17pm
20
It was needed on good browsers, as that bg color was messing things up.
I dunno about IE Sicks. Maybe see what happens by adding this to your style sheet:
* html #header {height: 150px;}
Or, if that doesn’t work, you could perhaps try
* html #header {display: inline;}
I’m not very good with IE6, and am so over that browser it’s not funny.
Yeah, to bad people are using it. Except for IE9, which is really good.