Jump to content

Mouse51180

New Members
  • Posts

    5
  • Joined

  • Last visited

Mouse51180's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Looks to be working now with your td suggestion...thank you for all the help.
  2. 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?
  3. Im starting to learn CSS and I have the following code that make a in img background, alternated colors in a table and then has a mouseover change of colors.<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 {text-align: center;} body {background-image: url(DiveFlagBackground.jpg);} tr:hover{background-color:#000; color:#00FF00}; </style> I have started to realize that depending where each line of code is will determine how everything run...for instance if I move my background-image line to the the top of the script...it disappears from the screen...im still working on understanding this, but that is nor here nor there right now. My issue is this...when I test this page in Chrome, everything looks how I want it. The table header section doesnt change any color, on mouseover only the table row with the table data changes color, and you can slightly see the image in the background through the table. When I test this in IE11 the opacity setting looks like it is being ignored and complete covers the whole background image. Also when I do the mouse over everything looks good except when I mouseover the table header section it changes to a slightly darker blue. It there an exclude or an "if row = th" or "if row = 0 color change = NULL" type of statement I need to put in? Not sure what to do about the opacity setting as I thought this code would work for anything past IE8. If you would like to see the issue my page is http://mouse.myds.me/Test1.php Thanks for any advise\help.
  4. I am just starting my first php mysql html page project and having a small issue. So I have a phpMyAdmin server running a database called "Dive_Log_DB". There is a table in this database called "DL_Logbook" I have the following code to test connection to the phpMyAdmin server, test the connection to the Dive_Log_DB database and then create a two column table to just test outputting data to (once I get this working I will work on adding the rest of the data). If I adjust the password to be wrong, I get my error message. If I adjust the database name to be misspelled I get my error message. By correct the information I get my success output statement..so I believe I am connecting to everything correctly. <!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>Web DIve Log Test</title> </head> <?php //Connect to phpMyAdmin: $SQLConnect = mysql_connect('localhost', 'MYUSERNAME', 'MYPASSWORD'); If(!$SQLConnect){ die(' ERROR: COULD NOT CONNECT TO SQL SERVER! ' .mysql_error()); } echo 'SQL SERVER CONNECTION SUCCESSFUL!' ."<br>"."<br>"; //Connect to Dive Log Database: $DBConnect = mysql_select_db('Dive_Log_DB', $SQLConnect); if(!$DBConnect){ die(' ERROR: COULD NOT CONNECT TO DATABASE! ' . mysql_error()); } echo 'DATABASE CONNECTION SUCCESSFUL!'."<br>"."<br>"; //Select which table to pull data from: $records = mysql_query('SELECT * FROM DL_Logbook'); //Pull data for table: While($row = mysql_fetch_assoc($records)){ echo "<tr>"; echo "<td>".$row['number']."</td>"; echo "<td>".$row['depth']."</td>"; echo "</tr>"; }//end while ?> <body> <table width = "100" border="1" cellpadding="1" cellspacing="1" <tr> <th>#</th> <th>Depth</th> <tr> </table> </body> </html> The above code outputs the following page: It is as if for some reason everything is connected, but no data is being grabbed. Does anyone have an idea why I am not getting any data in my table? Thank you for any advise in advance.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.