Forum Moderators: open

Message Too Old, No Replies

Navbar link boxs doubled in IE: 6/7

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

         

wayneprue

5:13 pm on Dec 22, 2007 (gmt 0)

10+ Year Member



First I'd like to say hi to everyone and seasons greetings. I'm new here and hope to find help and maybe give some in the future but I'm a novice coder just trying to learn. My problem is ... I'm having trouble with cross browser compatibility. I'm building a site and ... The navbar links all view and work normally in Firefox 2.0.0.11, iCab 3.0.3, Safari 1.3.2, Opera 9.25.3721, Navigator 9.0.0.3, SeaMonky 1.1.4, Mozilla 1.7.13 and Internet Explorer 5.2.3. for Macintosh but in Explorer 6 and 7 all the navbar-link boxes are doubled. The doubles have no text and are not links but the box is there and I have exhausted my searching for help on the web. until I found this site. I hope you can help.

And below, the code in question: I hope I have posted this properly and thanks in advance.

Wayne

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<div id="leftcolumn">
<div id="navcontainer">
<ul>
<li id="active"><a href="#"></a><a href="index.html">Home</a></li>
<li><a href="#"></a><a href="mailto:wayne@example.com">Contact</a></li>
<li><a href="#"></a><a href="linktestpage.html">About Us</a></li>
<li><a href="#"></a><a href="linktestpage.html">Service</a></li>
<li><a href="#"></a><a href="linktestpage.html">Processors</a></li>
<li><a href="#"></a><a href="linktestpage.html">Microphones</a></li>
<li><a href="#"></a><a href="linktestpage.html">Consoles</a></li>
<li><a href="#"></a><a href="linktestpage.html">Monitors</a></li>
<li><a href="#"></a><a href="linktestpage.html">Speakers</a></li>
<li><a href="#"></a><a href="linktestpage.html">Pro-Tools</a></li>
<li><a href="#"></a><a href="linktestpage.html">Mixers</a></li>
<li><a href="#"></a><a href="linktestpage.html">Software</a></li>
<li><a href="#"></a><a href="linktestpage.html">Outboard</a></li>
<li><a href="#"></a><a href="linktestpage.html">Effects</a></li>
<li><a href="#"></a><a href="linktestpage.html">dummy link</a></li>
<li><a href="#"></a><a href="linktestpage.html">dummy link</a></li>
<li><a href="#"></a><a href="linktestpage.html">dummy link</a></li>
<li><a href="#"></a><a href="linktestpage.html">dummy link</a></li>
<li><a href="#"></a><a href="linktestpage.html">dummy link</a></li>
<li><a href="#"></a><a href="linktestpage.html">dummy link</a></li>

</ul> </div>
-------------------------------

CSS:

div#leftcolumn {
padding: 2%;
float: left;
text-align: center;
background-color: #336699;
color: #232e3c;
border-right: solid #003366 medium;
width: 15.5%;
}
#navcontainer ul
{
margin: 0;
padding: 0;
list-style-type: none;
font-size: smaller;
}
#navcontainer li
{
margin: 0em 0em .4em 0em;
}
#navcontainer a
{
display: block;
color: #232e3c;
background-color: #517ec1;
width: 10em;
padding: .0em .8em;
border: .08em #003366 solid;
text-decoration: none;
font-style: italic; }
#active a
{
display: block;
color: #ffffff;
background-color: #517ec1;
width: 10em;
padding: .0em .8em;
border: .08em #003366 solid;
text-decoration: none;
font-style: italic; }
#navcontainer a:hover
{
background-color: #0033ff;
color: #FFF;
}

[edited by: encyclo at 11:57 pm (utc) on Dec. 22, 2007]
[edit reason] obscured email address [/edit]

ytswy

11:42 pm on Dec 22, 2007 (gmt 0)

10+ Year Member



Hi wayneprue, welcome to WebmasterWorld!

What is the purpose of the first empty anchor tag within each <li>? This bit I mean -

<li><a href="#"></a><a href="linktestpage.html">About Us</a></li>

The relevant style is this as far as I can see -
#navcontainer a
{
display: block;
color: #232e3c;
background-color: #517ec1;
width: 10em;
padding: .0em .8em;
border: .08em #003366 solid;
text-decoration: none;
font-style: italic; }

Which puts a border around the anchor tag and sets it to display: block. I think what is happening is that IE decides to make this empty tag a character high - looking at it in Firefox (Windows) it does seem to be rendered too, but the box there is only as high as the padding applied by the style.

wayneprue

12:35 am on Dec 23, 2007 (gmt 0)

10+ Year Member



ytswy,

Thank you for you help. Does that mean that I should remove (<a href="#"></a>)? There used to be a "span" in there and I removed it which made no difference but I guess I didn't remove the whole thing.

I'll go and study what you posted. Thank you and as I said, I'm new at this so please bear with me.

Wayne

ytswy

1:15 am on Dec 23, 2007 (gmt 0)

10+ Year Member



Yeah, just remove all the <a href="#"></a> if they don't have a reason to be there (ie something you stripped out before posting here) and you should be fine.

wayneprue

1:29 am on Dec 23, 2007 (gmt 0)

10+ Year Member



Wow ytswy, have I got a lot to learn. Thank you so much. I'm going to see about that.

Wayne

wayneprue

4:47 am on Dec 23, 2007 (gmt 0)

10+ Year Member



ytswy,

That fixed it. It takes me a while because I had to find someone to view it for me as I'm on a Mac. and for now don't have the tools to view IE:6/7 so thanks again.

Wayne

timster

3:13 pm on Dec 27, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Wayne, good to hear your immediate problem is fixed. Regarding testing on IE 6/7 on a Mac, here's a good thread:

[webmasterworld.com ]

wayneprue

5:52 pm on Dec 27, 2007 (gmt 0)

10+ Year Member



Thanks timester, I'm on my way ;-)

Wayne