1 reply [Last post]
pancakes
Offline
newbie
Last seen: 2 years 43 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 37 min ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9255
Points: 3261

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

UI design should be egoless; if you succumb to the temptation to show off, you’re probably doing it wrong. (from ESR)

There are enough html & css demos and tutorials to be interesting. Please visit.