Topic: Css Problems Pages that link to <a href="https://ozoneasylum.com/backlink?for=10882" title="Pages that link to Topic: Css Problems" rel="nofollow" >Topic: Css Problems\

 
Author Thread
Trigger
Paranoid (IV) Inmate

From:
Insane since: Jun 2002

IP logged posted posted 12-22-2002 10:29 Edit Quote

I've tried to learn CSS
but when I try and use class's they just dont work


Here's my code

quote:
body {color: black; background-color:white; FONT-FAMILY: verdana;}
table (background-color;}
td.top (background-color:#3399FF;}
td.nav {background-color:white;}

td {background-color:#FFFFFF;}



but when I use
<td class=top> a </td>

it dosent work,, am I missing something?

Veneficuz
Paranoid (IV) Inmate

From: A graveyard of dreams
Insane since: Mar 2001

IP logged posted posted 12-22-2002 13:53 Edit Quote

Use <td class="top"> a </td> instead and it should work. The font-family in body should be in lowercase...

_________________________
"There are 10 kinds of people; those who know binary, those who don't and those who start counting at zero"

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

IP logged posted posted 12-22-2002 17:11 Edit Quote

On top of that - if you don't have any atrributes specified for an item, don't list it. If your default TD background color is white, you don't need to specify a class with a white background color.



HZR
Bipolar (III) Inmate

From: Cold Sweden
Insane since: Jul 2002

IP logged posted posted 12-22-2002 17:30 Edit Quote

The problem is that you used a paranthesis instead of a '{' (don't know what they're called in english, heh) at the beginning of your declaration.

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

IP logged posted posted 12-22-2002 19:10 Edit Quote

The problem is the order in which you put your style sheet...

body {color: black; background-color:white; FONT-FAMILY: verdana;}
table (background-color;}
td.top (background-color:#3399FF;}
td.nav {background-color:white;}

td {background-color:#FFFFFF;}

When the browser encounters <td class="top">, it goes through each thing in the style sheet to see if it matches. ("Is it a <body> tag? no. Is it a <table> tag? no. Is it a <td> tag with class="top"? yes! So I'll set the background color to #3399FF. Is it a <td> tag with class="nav"? no. Is it a <td> tag? yes! So I'll set the background color to #FFFFFF.")

See the problem? Later things in the CSS override earlier things. So put the more general ones (like td) before the more specific ones (like td.top).

Edit: HZR is also correct.

[This message has been edited by Slime (edited 12-22-2002).]

HZR
Bipolar (III) Inmate

From: Cold Sweden
Insane since: Jul 2002

IP logged posted posted 12-22-2002 19:12 Edit Quote

Ahh, yes, that too, missed it.

Trigger
Paranoid (IV) Inmate

From:
Insane since: Jun 2002

IP logged posted posted 12-22-2002 22:32 Edit Quote

wow so many errors in such a small space,

Thanks for the help guys




Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu