Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS failing in IE / Works with Firefox/Netscape/Opera

Status
Not open for further replies.

WizyWyg

Technical User
Jan 31, 2001
854
JP
I have this in my CSS page:

Code:
a.mainlevell:link, a.mainlevel:visited {
	display: block;
	color: #FFFFFF;
	font-weight: bold;
	text-decoration: none;
	font-family: Verdana, Helvetica, Arial, sans-serif;
	margin-bottom: 1px;
	font-size: 12px;
}
a.mainlevell:hover {
color: #FFFF00;
font-size: 12px;
}

And I use this style for four links:
Code:
<a href="mobile.html" class="mainlevell">Home</a>
<a href="m_about.html" class="mainlevell">About Us</a>
<a href="m_games.html" class="mainlevell">Games</a>
<a href="m_links.html" class="mainlevell">Links</a>

When viewing in IE, all the URL's using m_* in the file name works with the CSS; the one referencing mobile.html doesn't.

However, putting an m_ in front of the mobile.html makes the link work.

Why?

This happens only in IE. firefox/opera/netscape/etc ; the links all show up fine and work as supposed to.

However, I have a similar set up for another menu that does almost the same CSS as the above:

Code:
<table width="100%" border="0" cellspacing="2" cellpadding="3">
                  <tr>
                    <td align="center" bgcolor="#990000"><img src="images/dmp_off.gif" name="home" width="14" height="14" id="home"></td>
                    <td bgcolor="#990000"><a href="mobile.html" class="menulevel" onMouseOver="MM_swapImage('home','','images/dmp_on.gif',1)" onMouseOut="MM_swapImgRestore()">Home</a></td>
                  </tr>
                  <tr> 
                    <td width="18" align="center" bgcolor="#990000"><img src="images/dmp_off.gif" name="one" width="14" height="14" id="one"></td>
                    <td bgcolor="#990000"><a href="m_blah.html" class="menulevel" onMouseOver="MM_swapImage('one','','images/dmp_on.gif',1)" onMouseOut="MM_swapImgRestore()">Blah</a></td>
                  </tr>
                  <tr> 
                    <td width="18" align="center" bgcolor="#990000"><img src="images/dmp_off.gif" name="two" width="14" height="14" id="two"></td>
                    <td bgcolor="#990000"><a href="m_blah.html" class="menulevel" onMouseOver="MM_swapImage('two','','images/dmp_on.gif',1)" onMouseOut="MM_swapImgRestore()">Blah</a></td>
                  </tr>
                  <tr> 
                    <td width="18" align="center" bgcolor="#990000"><img src="images/dmp_off.gif" name="three" width="14" height="14" id="three"></td>
                    <td bgcolor="#990000"><a href="m_blah.html" class="menulevel" onMouseOver="MM_swapImage('three','','images/dmp_on.gif',1)" onMouseOut="MM_swapImgRestore()">Blah</a></td>
                  </tr>
                  <tr> 
                    <td width="18" align="center" bgcolor="#990000"><img src="images/dmp_off.gif" name="four" width="14" height="14" id="four"></td>
                    <td bgcolor="#990000"><a href="m_blah.html" class="menulevel" onMouseOver="MM_swapImage('four','','images/dmp_on.gif',1)" onMouseOut="MM_swapImgRestore()">Blah</a></td>
                  </tr>
                  <tr> 
                    <td width="18" align="center" bgcolor="#990000"><img src="images/dmp_off.gif" name="five" width="14" height="14" id="five"></td>
                    <td bgcolor="#990000"><a href="m_blah.html" class="menulevel" onMouseOver="MM_swapImage('five','','images/dmp_on.gif',1)" onMouseOut="MM_swapImgRestore()">Blah</a></td>
                  </tr>
                  <tr> 
                    <td width="18" align="center" bgcolor="#990000"><img src="images/dmp_off.gif" name="six" width="14" height="14" id="six"></td>
                    <td bgcolor="#990000"><a href="m_blah.html" class="menulevel" onMouseOver="MM_swapImage('six','','images/dmp_on.gif',1)" onMouseOut="MM_swapImgRestore()">Blah</a></td>
                  </tr>
                </table>


and this one works fine ( even with the mobile.html)
 
If it wasn't just a typo, then you have one "l" missing in your mainlevel[red]l[/red]:visited declaration. If you visited mobile.html before that could break the look for that link. That is the only thing I can find. I tried your code on my system and had no problems in any browser. Is that all the code of the page or is there more? Do you have an online example of this oddity?
 
Wizy,

How are you referencing the .css file in the head of your web page?

~Daniel

He is no fool who gives what he cannot keep to gain what he cannot lose.
- Jim Elliot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top