0

What's the proper format?

Also does anyone know where i can find a good CSS online reference besides W3Schools?

Current Code.

.className td {border: 1px solid #CCC;}
.className th {border: 1px solid #CCC;}

i want to save some characters... would this be valid?

.className td th {border: 1px solid #CCC;}

or

.className td, th {border: 1px solid #CCC;}

or

.className td, .className th {border: 1px solid #CCC;}
6
Contributors
6
Replies
7
Views
11 Years
Discussion Span
Last Post by Arkinder
0

Both .className td, th {border: 1px solid #CCC;} and .className td, .className th {border: 1px solid #CCC;} are valid. They simply tell the browser different things.

The first states that the styles should be applied to any td element within an element with a class of className , and any th element within the document. The second states that the styles should be applied to any td element within an element with a class of className , and any th element within an element with a class of className .

If that doesn't make sense I can post an example.


Regards, Arkinder

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.