Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

chad.hassler

macrumors newbie
Original poster
Jun 18, 2009
9
0
Hi,
I am developing my website using Dreamweaver CS3. I have put a black background with some rollover links within the <style> tag. They work great in Firefox, Safari, Opera, but IE just gives me the standard blue underlined links and a white background. Any ideas on why this is happening.

Thanks
 
Can you post some code you're using? Be sure to use the code (button with #) and the HTML (button with <>) markup when posting to make it more readable. Also, what version of IE are you having trouble with?
 
I have tried it on 7 and 8. I haven't tried anything older.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
<style type="text/css">
<!--
a:link {
	color: #000000;
	text-decoration: none;
}
a:visited {
	text-decoration: none;
	color: #000000;
}
a:hover {
	text-decoration: none;
	color: #6B7711;
}
a:active {
	text-decoration: none;
	color: #000000;
}
.style4 {
	font-family: "Times New Roman", Times, serif;
	font-size: 24px;
}
body {
	background-color: #000000;
}
.style6 {font-family: "Century Gothic", Geneva, sans-serif}
.style7 {font-size: 14px}
.style8 {
	font-family: "Gill Sans Light", "Century Gothic", Geneva, sans-serif;
	font-size: 18px;
}
.style9 {font-size: 24px}
a {
	font-family: Century Gothic, Geneva, sans-serif;
}
-->
</style>
</head>

<body>
<table width="850" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td height="123" colspan="2" valign="top"><div align="center"> <br />
      <table width="50%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td valign="top"><div align="center"><a href="home.html"><img src="images/MoodysM.jpg" width="100" height="98" border="0" /></a></div></td>
            <td><div align="center"><img src="images/MoodysAuthenticFresh.jpg" width="262" height="108" /><span class="style8">   </span></div></td>
          </tr>
        </table>
        <hr align="center" width="65%" size="2" />
        <span class="style6"><a href="about.html">about</a> • <a href="farm.html">the farm</a> • <a href="products.html">products</a> • <a href="retail.html">retail stores</a>  • <a href="delivery.html">delivery</a> • <a href="custom.html">processing</a></span><br />
        <hr align="center" width="65%" size="2" />
        </div></td>
  </tr>
  <tr>
    <td width="33%" align="right" valign="top"> </td>
    <td width="67%" valign="top"><blockquote>
        <p class="style4"> </p>
      </blockquote></td>
  </tr>
</table>
</body>
</html>
 
Some of the properties are not ended within your style tag, close them up with ; like the others and see if that sorts out your issues.
 
I am still not following you. I am assuming you mean between the <style> tags, right? If so, I don't see anything that isn't closed. Sometimes they close out on the next line. That isn't what you are talking about is it?
 
Okay, I have fixed those. Sorry I was confused. I overlooked the ;

It still isn't working right though. Any other ideas?
 
I took the code and ran it in IE6 and it looks like it does in Firefox. The links have the proper coloring for the hover and active state as well. It's possible yours is using a partially cached version of the page.
 

Attachments

  • ie6-render.png
    ie6-render.png
    28.1 KB · Views: 90
I have tried it on two different computers. One with IE 7 and one with 8. They both do the same. I have refreshed them several times. Does IE 7 and 8 read CSS differently than other browsers?
 
I have tried it on two different computers. One with IE 7 and one with 8. They both do the same. I have refreshed them several times. Does IE 7 and 8 read CSS differently than other browsers?

Yes, but usually better ;)

The only other thing I can think of is that it doesn't like the HTML comment around the styles e.g., <!-- --> Try removing those lines to see if it has an effect.
 
Yes, but usually better ;)

The only other thing I can think of is that it doesn't like the HTML comment around the styles e.g., <!-- --> Try removing those lines to see if it has an effect.

Yeah, I tried that before I even posted this thread and all it does is puts everything within <style></style> at the top of the screen.
 
Yeah, I tried that before I even posted this thread and all it does is puts everything within <style></style> at the top of the screen.

Really? I don't have that issue when I try it. I never use the comment tags like that, but have seen others do it. It's actually only needed for very old browsers.
 
Could it be the span tag that's right in front of the anchor links? Could IE7 and 8 be looking for something like ".style6 a:hover" in the stylesheet?
 
I got it fixed. I had left out part of the code when I copied it onto the thread and there was a meta tag that had not be closed. It works fine now. Thanks for all of your help.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.