Thank you for the help...I have gotten some of this working now.
Make your selector be more specific tr:hover will affect any HTML element contained within the table row. However tr:hover td will only affect the <td> tags within the table row.
The tr:hover td worked to resolve the title changing color...I thought I had tried that once before, but perhaps I fat fingered the code.
I have also added the missing <STUFF> from my page. Im using Dreamweaver and it did not add all this by default since I chose to start this as a php page...everything was working fine...so I didnt think it was necessary.
Try using filter. IE is not always known for treating CSS properties the same as other browsers.
Im not getting the the opacity to work still. I have tried playing with the filter option, but I cant seem to get it to work.
I have replaced the opacity in code mentioned in the initial post
tr:nth-child(even) {background-color: #6FF; target: opacity(80%);}
I have tried adding it in addition to the current opacity code
tr:nth-child(even) {background-color: #6FF; opacity: .8; filter: opacity(80%);}
I have tried moving it around the code
tr:nth-child(even) {background-color: #6FF; opacity: .8;}
tr:nth-child(odd) {background-color: #FFF; opacity: .8;}
filter: opacity(80%);
tr:nth-child(even) {background-color: #6FF; opacity: .8;}
tr:nth-child(odd) {background-color: #FFF; opacity: .8;}
tr {filter: opacity(80%);}
...just cant make any headway with it.
Here is my current code for the whole page:
<!DOCTYPE html>
<html>
<head>
<?php
include_once("divelog_connect.php");
$sql = "SELECT * FROM DL_Logbook ORDER BY Number DESC LIMIT 0,20";
$records = mysqli_query($sql_connect,$sql);
?>
<style type="text/css">
th {
background-color: #00F;
color:#FFF;
font-size: large;
font-weight: bolder;
font-family: Georgia, "Times New Roman", Times, serif;
}
tr:nth-child(even) {background-color: #6FF; opacity: .8;}
tr:nth-child(odd) {background-color: #FFF; opacity: .8;}
tr:hover td{background-color:#000; color:#00FF00;}
body {background-image: url(DiveFlagBackground.jpg);}
tr {text-align: center};
</style>
</head>
<body>
<br />
<br />
<br />
<br />
<table align="center" border="5" cellpadding="5" cellspacing="2"
<col width="auto">
<tr>
<th>#</th>
<th>Dive Date</th>
<th>Dive Time</th>
<th>Max Depth <br /> (Feet/Meters)</th>
<th>Dive Site Name</th>
<th>Location</th>
</tr>
<?php
//Pull data for table:
While($DL_Logbook = mysqli_fetch_assoc($records)){
echo "<tr>";
echo "<td>".$DL_Logbook['Number']."</td>";
echo "<td>".$DL_Logbook['Divedate']."</td>";
echo "<td>".$DL_Logbook['Divetime'].' min'."</td>";
$meters = round($DL_Logbook['Depth'],1);
$feet = round(($meters * 3.2808),1);
echo "<td>" . $feet . ' ft / ' . $meters. ' m' . "</td>";
echo "<td>".$DL_Logbook['Place']."</td>";
echo "<td>".$DL_Logbook['City']."</td>";
echo "</tr>";
}//end while
?>
</table>
</body>
</html>
Where or how should this filter option be added?
One other item I just noticed was in Chrome my table has a 3d looking frame...in IE it has a solid black bar frame...im curious if I should probably create the table in the css section instead of the html body section... what is recommended or suggested or is it not going to make a difference either way IE just doesnt want to run the code like the other browsers?