css - Change font in php -


i trying change font of php section of website use googlefont. have tried various css options , style option nothing seems work. can please share ideas. here code:

    <!doctype html public "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html4/strict.dtd">     <html>     <head>     <title>view records</title>     <link href='http://fonts.googleapis.com/css?family=abel' rel='stylesheet' type='text/css'>      </head>     <body>      <?php     /*      view.php     displays data 'players' table     */      // connect database     include('connect-db.php');      // results database     $result = mysql_query("select * `men - iaaf world championships` 1")      or die(mysql_error());        echo "<table border='1' cellpadding='10'>";     echo "<tr> <th>event</th> <th>athlete 1</th> <th>performance</th> <th>athlete 2</th><th>performance</th><th>athlete 3</th><th>performance</th>      <th></th></tr>";      // loop through results of database query, displaying them in table     while($row = mysql_fetch_array( $result )) {      // echo out contents of each row table     echo "<font size='18' face='arial'><tr>";     echo '<td>' . $row['event'] . '</td>';     echo '<td>' . $row['athlete1'] . '</td>';     echo '<td>' . $row['performance1'] . '</td>';     echo '<td>' . $row['athlete2'] . '</td>';     echo '<td>' . $row['performance2'] . '</td>';     echo '<td>' . $row['athlete3'] . '</td>';     echo '<td>' . $row['performance3'] . '</td>';     echo '<td><a href="edit.php?id=' . $row['id'] . '">edit</a></td>';      echo "</tr>";      }       // close table>     echo "</table>";     ?>     </p>      </body>     </html>  

you need import font , use somewhere. imported abel font there not using it.

best way use google font defining new .css file this

@import url(http://fonts.googleapis.com/css?family=abel);  .newfont {  font-family: 'abel', sans-serif;  } 

then need use tag defined there in elements want. in example:

echo "<td class='newfont'>" . $row['event'] . "</td>"; echo "<td class='newfont'>" . $row['athlete1'] . "</td>"; echo "<td class='newfont'>" . $row['performance1'] . "</td>"; echo "<td class='newfont'>" . $row['athlete2'] . "</td>"; echo "<td class='newfont'>" . $row['performance2'] . "</td>"; echo "<td class='newfont'>" . $row['athlete3'] . "</td>"; echo "<td class='newfont'>" . $row['performance3'] . "</td>"; echo "<td class='newfont'>"<a href="edit.php?id=' . $row['id'] . '">edit</a></td>";  echo "</tr>";  }  

or can apply class body if want use font everywhere.


pd: need create new css file , need call header of .php file want use it.

example:

<link href="styles/newstyle.css" rel="stylesheet" type="text/css" /> 

Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -