-3

Below is my CSS script for a website I'm making:

@charset "utf-8";
/* CSS Document */
body{background-color:#3b5998; font-family:Tahoma, Geneva, sans-serif; color:red;}
link{color:red}
visited{color:purple}
hover{color:pink}
active{color:black}

Here's the HTML File

<!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>My Website</title>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>

<body>
<table width="115" height="484" border="5">
  <tr>
    <td width="97"><a href="home.html" target="mainFrame">Home</a></td>
  </tr>
  <tr>
    <td><a href="flashchart.html" target="mainFrame">Flash</a></td>
  </tr>
  <tr>
    <td><a href="browsertest.html" target="mainFrame">Browser Test</a></td>
  </tr>
  <tr>
    <td>Upload</td>
  </tr>
  <tr>
    <td>Download</td>
  </tr>
  <tr>
    <td>Exit</td>
  </tr>
</table>
</body>
</html>

It doesn't seem to be working... What's wrong?

Canadian Luke
  • 24,339

2 Answers2

1

I think you mean this:

body{background-color:#3b5998; font-family:Tahoma, Geneva, sans-serif; color:red;}

a{color:red;}

a:visited{color:purple;}

a:hover{color:pink;}

a:active{color:black;}
  • No, I wanted to be able to import the CSS and have it apply to everything instead of having to add a tag to everything – Will Walker Jun 25 '13 at 20:02
  • link, visited, hover and active are all selectors. They are active when the tag is in a certain state. They don't work if you don't say which tag they belong to (an anchor, I assume in this case). If you meant to use them as a class or an id, you should write '#visited' for an id or '.visited' for a class. – Simon Verbeke Jun 25 '13 at 20:07
  • @SimonVerbeke 's answer works, add in the "a" (anchor / link) tags – hanxue Jun 25 '13 at 20:22
-1

Add the missing semicolons and the tags

body{background-color:#3b5998; font-family:Tahoma, Geneva, sans-serif; color:red;}

a:link{color:red;}

a:visited{color:purple;}

a:hover{color:pink;}

a:active{color:black;}
hanxue
  • 3,020