|
Posted by Jukka K. Korpela on 04/27/07 14:05
Scripsit Sonnich:
> Say, I have:
>
> font { font-family: Verdana, Arial, Helvetica, sans-serif; color:
> #333333; text-decoration: none; font-size: 12px}
> td { font-family: Verdana, Arial, Helvetica, sans-serif; color:
> #333333; text-decoration: none; font-size: 12px }
> .aa2 { font-family: Tahoma; color: #990000; text-decoration: none;
> cursor: hand }
Then you should forget all you thought you knew about CSS and start learning
it properly. There are many good books on it around. (I could send you mine
but it's in Finnish. :-))
Not a single setting in the fragment is good, useful CSS. It would take too
many pages to explain why, and a URL would be needed to explain in detail
why the settings are all wrong. But that's not important right now. Just two
examples: The font element should not be used, so why are you using its name
as a selector? Setting font size in pixels is destructive since it prevents
most IE users from changing the font size, and many millions of them cannot
read 12px text. (You don't even know the size of a pixel on other people's
screens.)
> Idea: default colour is set, though for some <tr I'd like to set the
> class like <tr class='aa2'> etc...
> It works with <td class='aa2'>, but not for <tr
That's not a problem. The simplest approach is to use .aa2 as a selector
(just dot and class name). You would set the color of the tr element, and
this color would be inherited by td elements inside it, unless some style
sheet sets their color. Of course, you shouldn't use a class name like
'aa2', which says nothing when you try to figure out next year how your page
works when a problem has detected.
--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
Navigation:
[Reply to this message]
|