View Full Version : help with CSS for tables


malachithree10
02-12-2004, 04:45 PM
Hello...hope you can help me..
I need a different CSS for my menu than I do for my main tables on my site.
I have my links on my main table as blue, but I don't want that for my menu, I want the links a different color and a different size.

Is there a way to do this?
Thank you all!

Rosey
02-12-2004, 07:42 PM
you can set up classes in your css:

.menu { css stuff in here }

and then in your table you can do <table class="menu">

if that doesn't work you can put it directly in the td tags but it should work in the table tags.

pb&j
02-13-2004, 04:09 AM
.menu a {style codes;}
.menu a:active {style codes;}
.menu a:hover {style codes;}


<div class="menu">
links here
</div>

Rosey
02-13-2004, 05:12 AM
oh sorry i didn't see that you wanted the links part..sorry

Bee
02-13-2004, 07:43 AM
xxx

malachithree10
02-16-2004, 03:41 PM
Can you help me out a bit more? Here is my CSS:

<HTML>
<HEAD>

<STYLE type=text/css>
A:link
{font-weight: bold;
color: #4B91AB;
TEXT-DECORATION: none}
A:hover {COLOR: #EE8B16;}
A:visited {TEXT-DECORATION: none; font-weight: bold;}
A:active {TEXT-DECORATION: none}

iframe
{background-image: url(graphics/whiteword.jpg);
background-repeat: no-repeat;
background-position: center center;
background-attachment: fixed;}

BODY
{font-family: verdana, arial, lucida sans;
font-size: 8pt;
SCROLLBAR-FACE-COLOR: #ffffff; SCROLLBAR-HIGHLIGHT-COLOR: #000000; SCROLLBAR-SHADOW-COLOR: #000000; SCROLLBAR-ARROW-COLOR: #000000; SCROLLBAR-TRACK-COLOR: #ffffff; SCROLLBAR-DARKSHADOW-COLOR: #ffffff; SCROLLBAR-BASE-COLOR: #ffffff; scrollbar-3d-light-color: #ffffff}

TD
{font-family: verdana, arial, lucida sans;
font-size:8pt;}

</STYLE>
</HEAD>

<BODY text=#000000 vLink=#4B91AB aLink=#4B91AB link=#4B91AB background= "graphics/stonedblack.jpg">



Where would I place the .menu? Don't I have to classify each table on the page? I have one table for my menu and one table for my welcome. I want a different CSS for each table. Right now my links are all the same when hovering, visiting, active, etc. I want the menu table to be different.
Maybe I am confused by the way you listed it here compared to the way I created my own CSS? Thank you for helping me understand. :)

Rosey
02-16-2004, 04:00 PM
In your current css, if the links are fine for one table, don't do anything to that table.


For the other one, put the .menu in your css like this:


after this:

TD
{font-family: verdana, arial, lucida sans;
font-size:8pt;}

.menu a {style codes;}
.menu a:active {style codes;}
.menu a:hover {style codes;}

</style>

malachithree10
02-17-2004, 05:09 PM
Should this work? Because it isn't currently working right now. I don't understand where I am messing up here. It is still working as my main CSS for my links. Am I doing something wrong within my style sheet?

<STYLE type=text/css>
A:link
{font-weight: bold;
color: #4B91AB;TEXT-DECORATION: none}
A:hover {COLOR: #EE8B16;}
A:visited {TEXT-DECORATION: none; font-weight: bold;}
A:active {TEXT-DECORATION: none}


iframe
{background-image: url(graphics/whiteword.jpg);
background-repeat: no-repeat;
background-position: center center;
background-attachment: fixed;}

BODY
{font-family: verdana, arial, lucida sans;
font-size: 8pt;
SCROLLBAR-FACE-COLOR: #ffffff; SCROLLBAR-HIGHLIGHT-COLOR: #000000; SCROLLBAR-SHADOW-COLOR: #000000; SCROLLBAR-ARROW-COLOR: #000000; SCROLLBAR-TRACK-COLOR: #ffffff; SCROLLBAR-DARKSHADOW-COLOR: #ffffff; SCROLLBAR-BASE-COLOR: #ffffff; scrollbar-3d-light-color: #ffffff}

TD
{font-family: verdana, arial, lucida sans;
font-size:8pt;}

.menu a {font-family: verdana, arial, lucida sans;
font-size:8pt; COLOR: #c00000;}
.menu a:active {font-family: verdana, arial, lucida sans;
font-size:8pt;}
.menu a:visited {font-family: verdana, arial, lucida sans;
font-size:8pt; TEXT-DECORATION: none; font-weight: bold;}
.menu a:hover {font-family: verdana, arial, lucida sans;
font-size:8pt; COLOR: #000000;}

</STYLE>

</HEAD>

malachithree10
02-17-2004, 05:14 PM
my menu is actually a table within the same page. It is a seperate menu where each page links to it. It is a table and I added the table to each page of my site.
Here is a link to a page I am trying to create this menu from:
http://vicarybiznis.tripod.com/index21.html

kittycat
02-17-2004, 09:41 PM
Your CSS is fine, the only thing you forgot to do is add the class="" part to the tag.
<TABLE BORDER="1" bordercolor="#000000" CELLPADDING="0" CELLSPACING="0" WIDTH="150" HEIGHT="375" class="menu">
Since you also have a div containing your links you could add class="menu" to it instead.

malachithree10
02-18-2004, 12:04 AM
Your CSS is fine, the only thing you forgot to do is add the class="" part to the tag.
<TABLE BORDER="1" bordercolor="#000000" CELLPADDING="0" CELLSPACING="0" WIDTH="150" HEIGHT="375" class="menu">
Since you also have a div containing your links you could add class="menu" to it instead.

You really just never know what you are leaving out to make one simple thing work. I appreciate your help very much.
Thanks. :)