CSS Page Problem

Hamill

Solid State Member
Messages
18
Im coding my site using CSS, and it includes a fair amount of PHP.

All of the text is meant to be 10pt, Verdana and a silvery/grey colour.

Here is a snippet of my code, was hoping some of you could tell me why it's not working, i've tried everything.
Code:
<html>
<head>
<title>Table View</title>
<style type="text/css">
body
{
background-color: #CACACA;
}
#content
	{
	font-size:10px;
 	font-family: verdana;   
 	font-color:#808285; 
	text-decoration: none;
	}
}
A,A:Visited,A:Active
	{
 	font-size:10px;
 	font-family: verdana; 
 	width: 100px;  
 	color:#808285; 
	text-decoration: none;

}
A:Hover 
    	{
	font-size:10px; 
        font-family: verdana;
 	font-weight:none; 
 	text-decoration:none; 
	background-color:none; 
 	width: 100px;  
 	color:#808285;
}
.baselinestyle
	{
	font-size:10px; 
        font-family: verdana;
 	font-weight:none; 
 	text-decoration:none; 
 	background-color:none; 
 	width: 100px;  
 	color:#808285;

</style>
</head>
<body>
<table>
<div id="content">
<tr>
<th>PlayerID</th>
<th>FirstName</th>
<th>LastName</th>
<th>Telephone No</th>
<th>Address</th>
<th>Date of Birth</th>
<th>Post Code</th>
<th>E-mail</th>
</tr>
<?
		$hostname="hamill.dns-systems.net";
		$username="hamill_hook";
		$password="asd123";
		$database="hamill_hook";

		mysql_connect($hostname,$username,$password);
		@mysql_select_db($database) or die( "Unable to select database");
		$query="SELECT * FROM Player";
		$result=mysql_query($query);

		$num=mysql_numrows($result);

		mysql_close();

		if ($num==0) {
		echo "The database contains no players.";
		} else {
		}

		$i=0;
		while ($i < $num) {
		$PlayerID=mysql_result($result,$i,"PlayerID");
		$FirstName=mysql_result($result,$i,"FirstName");
		$LastName=mysql_result($result,$i,"LastName");
		$TelNo=mysql_result($result,$i,"TelNo");
		$AddressLine1=mysql_result($result,$i,"AddressLine1");
		$DOB=mysql_result($result,$i,"DOB");
		$PostCode=mysql_result($result,$i,"PostCode");
		$Email=mysql_result($result,$i,"Email");
		?>

<tr>
<td><? echo $PlayerID; ?></td>
<td><? echo $FirstName; ?></td>
<td><? echo $LastName; ?></td>
<td><? echo $TelNo; ?></td>
<td><? echo $AddressLine1; ?></td>
<td><? echo $DOB; ?></td>
<td><? echo $PostCode; ?></td>
<td><a href="mailto:<? echo $Email; ?>">E-mail</a></td>
</tr>
</div>
		<?
		$i++;
		}
echo "</table>";
echo "To view the table in ascending order using LastName, click <a href=\"http://www.hamilldesigns.co.uk/playerasc.php\">here</a>";

You can also take a look at the pagehere.

Any suggestions would be grateful. Thanks. :)
 
Yeah, its not real information :p. and even if it was, i trust all you guys on here anyway :p

Well, the text isn't the colour its meant to be, nor the size. I have no idea why not, so im hoping has can enlighten me :)
 
Personally, I would use external stylesheets.. But it shouldn't really matter.

If you want all the text on that page to have the same properties, try adding them all to the body tag instead...

For example:

Code:
body {
	font-family:Verdana, Arial, Helvetica, sans-serif;
	font-size:10px;
	color:#808285;
}
That should work..

Jamie.
 
indeed, external style sheets are better in terms of when you want to change the site yuo only have to update one style sheet rather than the style bklock at the top of each page!

as for why it's not working...

as this simple example shows
Code:
<html>
<style>
#content {
color:red;
}
#content2 {
border: 2px dashed blue;
}
</style>
<body>
<div id="content">
hello
<table><tr><td>goodbye</td></tr><table>
hello again
<div id="content2">
still here
</div>
</div>
</body>
</html>[code]
style isn't applied equally across all elements, style can cascade into different divs, but not into tables, or anything written inside a table... (unless that particular thing has a class applied...


either body tag, or apply it to the table elements, (applying body elements does cascade through to the table), but will also cascade to areas that are currently unstyled...
[code]
table, tr, th, td {
	font-family:Verdana, Arial, Helvetica, sans-serif;
	font-size:10px;
	color:#808285;
}

a second way to do this would be to change the code like this

Code:
.content
	{
	font-size:10px;
 	font-family: verdana;   
 	font-color:#808285; 
	text-decoration: none;
	}
}
...
...
<th class="content">PlayerID</th>
<th class="content">FirstName</th>
<th class="content">LastName</th>
...
etc
...
 
Yeah, eventually i will get around to creating external stylesheets, as they are alot better. Thanks for the help fellas, i will get round to using some of your suggestions a bit later. Cheers again.
 
Back
Top Bottom