Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 12-15-2006, 10:24 AM   #1
Solid State Member
 
Hamill's Avatar
 
Join Date: Jan 2005
Posts: 18
Default CSS Page Problem

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.
__________________

Hamill is offline   Reply With Quote
Old 12-15-2006, 01:42 PM   #2
Golden Master
 
borat_sagdiyev's Avatar
 
Join Date: Feb 2006
Posts: 8,986
Send a message via AIM to borat_sagdiyev Send a message via MSN to borat_sagdiyev
Default Re: CSS Page Problem

wow nice disclosing people's personal information lol. but yeah umm hows it not working?
__________________

__________________
Core 2 Duo e4500 2.2ghz @ 2.8ghz
evga 650i ultra
2gb 400mhz ram OC'ed to 450
evga geforce 7600GT overclocked
borat_sagdiyev is offline   Reply With Quote
Old 12-15-2006, 05:29 PM   #3
Solid State Member
 
Hamill's Avatar
 
Join Date: Jan 2005
Posts: 18
Default Re: CSS Page Problem

Yeah, its not real information :P. and even if it was, i trust all you guys on here anyway

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
Hamill is offline   Reply With Quote
Old 12-16-2006, 08:04 AM   #4
In Runtime
 
jamieoliver22's Avatar
 
Join Date: Apr 2004
Posts: 245
Default Re: CSS Page Problem

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.
__________________
Desktop: AMD Athlon XP 2000+ - 1.6ghz | MSI KT4-Ultra Motherboard |ATI Radeon Powercolor x850 XT 256mb DDR3 | 400gb HDD space |1gb PC2700 DDR SDRAM.
---
Laptop: AMD Sempron 3200+ - 1.6ghz | ATI Radeon Xpress 1100 - 128mb | 100gb PATA HDD | 1gb DDR2 RAM.
jamieoliver22 is offline   Reply With Quote
Old 12-16-2006, 01:53 PM   #5
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,003
Default Re: CSS Page Problem

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
...
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 12-16-2006, 03:25 PM   #6
Solid State Member
 
Hamill's Avatar
 
Join Date: Jan 2005
Posts: 18
Default Re: CSS Page Problem

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.
__________________

Hamill is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 10:51 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0