Forum Moderators: not2easy

Message Too Old, No Replies

What kind of CSS is this?

         

MatthewHSE

3:49 pm on Aug 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I came across some CSS the other day that I don't understand. Here's a sample:

.MenuRow td {
color: #435670;
font-color: #435670;
font-size: 13px;
text-align: left;
}

I've never used classes in that format before. Is ".MenuRow td" just another way to write "td.MenuRow"?

benihana

3:53 pm on Aug 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



afaik
.menuRow td would apply where you had (e.g.)
<span class="menuRow"><td>....

and the other would be more like <td class="menuRow">

hope someone can shed a little more light...

coopster

3:54 pm on Aug 14, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



benihana nailed it.

fkottar

4:03 pm on Aug 14, 2003 (gmt 0)

10+ Year Member



benihana you are right.
Other formats you may want to use are:

#foo {
color: #FFFFFF;
}
Any object with id=foo

td#foo {
color: #FFFFFF;
}
td with id=foo

table#foo td {
color: #FFFFFF;
}
Any td within a table with id=foo (such as <table id="foo"><tr><td>Hello</td><tr></table> )

td#foo, td.bar {
color: #FFFFFF;
}
td with id=foo or class=bar (you can combine as many as you want separating them with commas, using any of the previous formats)

Nick_W

4:06 pm on Aug 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Also, there is no such thing as font-color, it's just color...

Nick

MatthewHSE

4:09 pm on Aug 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks everyone. That will be a handy CSS tip to know.

(And by the way, Nick_W, I know "font-color" isn't correct; this isn't my CSS. I just came across it recently and was wondering about that first line! :) )

bachius

4:20 pm on Aug 14, 2003 (gmt 0)

10+ Year Member



This link is great if you're ever wondering again:
[penguin.theopalgroup.com...]

It tells you this:

Selector 1: *.MenuRow td

Selects any td element that is a descendant of any element with a class attribute that contains the word MenuRow.

MatthewHSE

4:41 pm on Aug 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for the link bachius! That tool is great; should come in handy if I ever find any more CSS I don't quite get!