...

View Full Version : Pesky CSS problem (PC vs Mac differences)



inbetweendays
12-23-2007, 10:52 PM
I am setting up a menu navigation for a website I am working on... However I am running into a pesky CSS issue. The menu looks fine/great on PC versions of IE and Firefox, however on Linux or Mac it appears slightly different and funky. The problem is that if I tweak the CSS to make the menu look good on the Mac, it then looks funky on in IE6, IE7, and Firefox on the PC.

Has anyone run into this issue before or recommend an appropriate solution? Thanks in advance!

Below are screenshots and the CSS code.

Screenshot on Windows IE6:
http://www.grafiks.org/bugs/Screenshot-PC.jpg

Screenshot on Mac Firefox:
http://www.grafiks.org/bugs/Screenshot-Mac.jpg
(Note the extra space below the Inbox button)

CSS Snippet:

#mainnavin {
height:30px; width:673px;
background-color:#687A9C;
color:#fff;
background: url(../images/mainnavbg.gif) center center repeat-x;
overflow:auto;
}

#mainnavin ul{
height:30px;
font-size:12pt;
margin: 0;
padding: 0;
float: left;
background: url(../images/mainnavbg.gif) center center repeat-x;
}

#mainnavin ul li{
display: inline;

}

#mainnavin ul li a{
padding:4px 20px;
float: left;
color: #fff;
text-decoration: none;
border-right: 1px solid #283B76;
}

#mainnavin ul li a:visited{
color: #fff;
}

#mainnavin ul li a:hover, #mainnavin ul li .current{
color: #fff;
background: url(../images/mainnavbg2.gif) center center repeat-x;
}

HTML Snippet:

<div id="mainnavin">
<ul>
<li><a href="index.html">Welcome</a></li>
<li><a href="inbox.html" class="current">Inbox</a></li>
<li><a href="#">Features</a></li>
</ul>
</div>

Excavator
12-23-2007, 11:02 PM
Hello inbetweendays,
Extra spaces like that are often caused by different browsers default margins or padding...
It might help to clear all margin/padding by adding this to your CSS

* {
margin: 0;
padding: 0;
}

inbetweendays
12-23-2007, 11:39 PM
Hi Excavator. Thank you for the feedback... I actually already have that bit of code at the top of my CSS file but still seem to be getting this issue. Any other suggestions? Thanks!

Excavator
12-24-2007, 02:00 AM
Pretty hard to say with only a snippet and no images, not to mention no Mac ... could be anything.

That's the problem with only a snippet of code, the person helping can't see that you already used the * to clear margins/padding. Better to give us a link or post the whole code so people can see everything that might be causing the problem.

VIPStephan
12-24-2007, 03:17 PM
Play around with line height that’s probably a different default in different browsers.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum