1 reply [Last post]
pancakes
Offline
newbie
Last seen: 4 years 17 weeks ago
Joined: 2012-01-24
Posts: 1
Points: 2

Hello all.
I hate to feel like I'm wasting people's time with this, because I know I'm probably missing something really small, and really obvious, but it's driving me INSANE.

Basically, all I want is for some text to be one colour when standard, another colour when hovered over. I can get it to work fine straight away in Firefox and Chrome, but IE refuses to pay any attention to it.

I've been trying to break it down, so here is my incredibly simple bit of code:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta
 content="text/html; charset=ISO-8859-1"
 http-equiv="content-type">
  <title></title>
  <style title="stylesheet"
 type="text/css">
body
{background-color:green;}
a1
{
color:white;
}
a1:hover
{
color:black;
} </style>
</head>
<body>
<br>
<a1>Hello</a1>
</body>
</html>

Like I said, works perfectly in FF and C, but not IE. What am I doing wrong?

Thanks in advance! =D

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 5 hours 4 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9549
Points: 3603

What is <al>? Browsers that

What is <al>? Browsers that support xhtml as xhtml will style the element as if you had extended the DTD. IE is not so lenient with non-standard elements.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.