...

View Full Version : Tables and Hover



doug2r
10-27-2006, 01:58 AM
I am unable to get hover to work on the <th> line in a table. Here is an example table. It doesn't like the <a=href"#"> on the <th> line. The CSS that I am using is shown below:

<table id="table3">
<tr>
<th scope="col"<a=href"#">&nbsp;&nbsp;&nbsp;&nbsp;Item 1</th>
</tr>
<tr>
<td><a href="#">&nbsp;&nbsp;&nbsp;&nbsp;Item 2</td>
</tr>
<tr>
<td><a href="#">&nbsp;&nbsp;&nbsp;&nbsp;Item 3</td>
</tr>

#table3 th:a: hover {
text-decoration: none;
color: white;
background-color: black;
{

#table3 td:a: hover {
text-decoration: none;
color: white;
background-color: black;
{

The td CSS gives a successful hover, but the th does not. I don't think to ever gets as far as the <th> CSS entry because it doesn't like the "<href="#"> in the HTMl.

_Aerospace_Eng_
10-27-2006, 02:05 AM
Bad html and bad CSS don't help when it comes to getting things to work. You need to make sure both are valid. Compare this to what you have

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
#table3 th a:hover {
text-decoration: none;
color: white;
background-color: black;
}

#table3 td a:hover {
text-decoration: none;
color: white;
background-color: black;
}
</style>
</head>
<body>
<table id="table3">
<tr>
<th scope="col"><a href="#">&nbsp;&nbsp;&nbsp;&nbsp;Item 1</a></th>
</tr>
<tr>
<td><a href="#">&nbsp;&nbsp;&nbsp;&nbsp;Item 2</a></td>
</tr>
<tr>
<td><a href="#">&nbsp;&nbsp;&nbsp;&nbsp;Item 3</a></td>
</tr>
</table>
</body>
</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum