Hey guys,
I have built a suckerfish navigation menu using CSS and HTML with unordered lists. I was testing this menu in Safari, and it came out good. When I finished I tested it in firefox and then in IE ( I know I should have done this before hand) and noticed that both browsers displayed the menu differently than Safari. There is an problem with the dropdown hover state in Firefox, and the menu is just mangled in IE (I think it may be a table issue).
I do not know much about CSS hacks for IE of Firefox. I don't know If I should build a seperate style sheet for the different browsers or what. I would appreciate if someone would help me out on this, or just point me in the right direction. Below is the CSS I use for my unordered lists.
Thanks
[CODE=css]
/* My CSS Document */
.my_nav {
width:100%;
text-align: center;
position:relati ve;
font-family:arial, verdana, sans-serif;
font-size:12px;
background: url(images/nav_headerbg.gi f);
height:66px;
margin:10px 1px;
}
.my_nav .select {
margin:0;
padding:0;
list-style:none;
white-space:nowrap;
}
.my_nav .select li a{
float:left;
background: url(images/nav_tabPipe.gif ) right no-repeat;
}
.my_nav .select a {
display: block;
float: none;
padding-top: 10px;
padding-right: 9px;
padding-bottom: 18px;
padding-left: 0px;
text-decoration: none;
white-space: nowrap;
color: #003366;
}
.my_nav .select a {
display: block;
padding:10px 8px 18px 6px;
}
.my_nav .select li.active a,.my_nav .select li.active:hover a {
text-decoration: none;
text-align: center;
color:#fff;
background: url(images/nav_tabOn.gif) 0% 0px no-repeat;
z-index: 2;
}
.my_nav .select li.active a{
text-decoration: none;
color: #fff;
}
.my_nav .select li:hover a {
text-decoration: none;
text-align: center;
/*background-image: url(images/nav_tabHover.gi f);*/
}
.my_nav .select li:hover a {
text-decoration: none;
/*background: url(images/nav_tabHover.gi f) 0% 0px no-repeat;*/
color: red;
}
.my_nav .sub {
display: none;
margin: 0;
padding: 0;
list-style: none;
}
/* IE6 only */
.my_nav table {
border-collapse:collap se;
margin:-1px;
font-size:1em;
width:0;
height:0;
}
.my_nav .sub {
margin:0;
padding:0;
list-style:none;
}
.my_nav .select .active .sub {
display:block;
position:absolu te;
float:left;
width:100%;
top:35px;
text-align:center;
}
.my_nav .select .active .sub li a {
display:block;
line-height:32px;
float: left;
background:none ;
padding:0 11px;
margin:0;
white-space:nowrap;
color:#444;font-size:11px;
}
.my_nav .select :hover .sub{
display: block;
background: url(images/nav_subNavBg.gi f) repeat-y ;
z-index: 1;
position: absolute;
float: left;
width: 100%;
top:40px;
text-align: center;
color: #003399;
}
.my_nav .select :hover .sub li a {
display: block;
line-height: 23px;
background: none;
float: left;
padding:0 11px;
margin:0;
white-space:nowrap;
color:#444;font-size:11px;
}
.my_nav .select :hover .sub li a:hover{
color:#444;
text-decoration:unde rline;
}
[/CODE]
I have built a suckerfish navigation menu using CSS and HTML with unordered lists. I was testing this menu in Safari, and it came out good. When I finished I tested it in firefox and then in IE ( I know I should have done this before hand) and noticed that both browsers displayed the menu differently than Safari. There is an problem with the dropdown hover state in Firefox, and the menu is just mangled in IE (I think it may be a table issue).
I do not know much about CSS hacks for IE of Firefox. I don't know If I should build a seperate style sheet for the different browsers or what. I would appreciate if someone would help me out on this, or just point me in the right direction. Below is the CSS I use for my unordered lists.
Thanks
[CODE=css]
/* My CSS Document */
.my_nav {
width:100%;
text-align: center;
position:relati ve;
font-family:arial, verdana, sans-serif;
font-size:12px;
background: url(images/nav_headerbg.gi f);
height:66px;
margin:10px 1px;
}
.my_nav .select {
margin:0;
padding:0;
list-style:none;
white-space:nowrap;
}
.my_nav .select li a{
float:left;
background: url(images/nav_tabPipe.gif ) right no-repeat;
}
.my_nav .select a {
display: block;
float: none;
padding-top: 10px;
padding-right: 9px;
padding-bottom: 18px;
padding-left: 0px;
text-decoration: none;
white-space: nowrap;
color: #003366;
}
.my_nav .select a {
display: block;
padding:10px 8px 18px 6px;
}
.my_nav .select li.active a,.my_nav .select li.active:hover a {
text-decoration: none;
text-align: center;
color:#fff;
background: url(images/nav_tabOn.gif) 0% 0px no-repeat;
z-index: 2;
}
.my_nav .select li.active a{
text-decoration: none;
color: #fff;
}
.my_nav .select li:hover a {
text-decoration: none;
text-align: center;
/*background-image: url(images/nav_tabHover.gi f);*/
}
.my_nav .select li:hover a {
text-decoration: none;
/*background: url(images/nav_tabHover.gi f) 0% 0px no-repeat;*/
color: red;
}
.my_nav .sub {
display: none;
margin: 0;
padding: 0;
list-style: none;
}
/* IE6 only */
.my_nav table {
border-collapse:collap se;
margin:-1px;
font-size:1em;
width:0;
height:0;
}
.my_nav .sub {
margin:0;
padding:0;
list-style:none;
}
.my_nav .select .active .sub {
display:block;
position:absolu te;
float:left;
width:100%;
top:35px;
text-align:center;
}
.my_nav .select .active .sub li a {
display:block;
line-height:32px;
float: left;
background:none ;
padding:0 11px;
margin:0;
white-space:nowrap;
color:#444;font-size:11px;
}
.my_nav .select :hover .sub{
display: block;
background: url(images/nav_subNavBg.gi f) repeat-y ;
z-index: 1;
position: absolute;
float: left;
width: 100%;
top:40px;
text-align: center;
color: #003399;
}
.my_nav .select :hover .sub li a {
display: block;
line-height: 23px;
background: none;
float: left;
padding:0 11px;
margin:0;
white-space:nowrap;
color:#444;font-size:11px;
}
.my_nav .select :hover .sub li a:hover{
color:#444;
text-decoration:unde rline;
}
[/CODE]
Comment