Connecting Tech Pros Worldwide Help | Site Map

Multiple selectors in rule

  #1  
Old July 8th, 2008, 12:25 PM
Axel Siebenwirth
Guest
 
Posts: n/a
Hi,

I've tried to do this but it does not work.

table.anmeldung tr + td { font-weight:bold; }

I'm looking for an easy way to bolden the left column in this table:
http://www.kunstwerk-jena.de/sommer_anm.html

Any comments?

Thanks a lot,
Axel
  #2  
Old July 8th, 2008, 12:55 PM
Bjoern Hoehrmann
Guest
 
Posts: n/a

re: Multiple selectors in rule


* Axel Siebenwirth wrote in comp.infosystems.www.authoring.stylesheets:
Quote:
>I've tried to do this but it does not work.
>
>table.anmeldung tr + td { font-weight:bold; }
This matches 'td' elements with a ('tr' sibling that is a child of a
(table element that belongs to the class 'anmeldung')). Since td and
tr do not occur as siblings, this matches nothing.
Quote:
>I'm looking for an easy way to bolden the left column in this table:
>http://www.kunstwerk-jena.de/sommer_anm.html
You might be looking for

table.anmeldung tr td:first-child { font-weight: bold; }

You might look into using the 'th' element instead though.
--
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
  #3  
Old July 8th, 2008, 01:45 PM
David Stone
Guest
 
Posts: n/a

re: Multiple selectors in rule


In article
<7vk674huh3ovn56rsj0o35qiog7nbsdif2@hive.bjoern.ho ehrmann.de>,
Bjoern Hoehrmann <bjoern@hoehrmann.dewrote:
Quote:
* Axel Siebenwirth wrote in comp.infosystems.www.authoring.stylesheets:
Quote:
I've tried to do this but it does not work.

table.anmeldung tr + td { font-weight:bold; }
>
This matches 'td' elements with a ('tr' sibling that is a child of a
(table element that belongs to the class 'anmeldung')). Since td and
tr do not occur as siblings, this matches nothing.
>
Quote:
I'm looking for an easy way to bolden the left column in this table:
http://www.kunstwerk-jena.de/sommer_anm.html
>
You might be looking for
>
table.anmeldung tr td:first-child { font-weight: bold; }
>
You might look into using the 'th' element instead though.
That's what I did in an analagous situation: headings are in
the first column and data is in rows:
http://www.chem.utoronto.ca/courseno...inPortion.html

Surprisingly enough, it appears to work!
  #4  
Old July 8th, 2008, 01:45 PM
Axel Siebenwirth
Guest
 
Posts: n/a

re: Multiple selectors in rule


This doesn't seem to work.

http://www.kunstwerk-jena.de/sommer_anm.html
http://www.kunstwerk-jena.de/default.css

Also tried the same with th.

Thanks,
Axel

Bjoern Hoehrmann wrote:
Quote:
* Axel Siebenwirth wrote in comp.infosystems.www.authoring.stylesheets:
Quote:
>I've tried to do this but it does not work.
>>
>table.anmeldung tr + td { font-weight:bold; }
>
This matches 'td' elements with a ('tr' sibling that is a child of a
(table element that belongs to the class 'anmeldung')). Since td and
tr do not occur as siblings, this matches nothing.
>
Quote:
>I'm looking for an easy way to bolden the left column in this table:
>http://www.kunstwerk-jena.de/sommer_anm.html
>
You might be looking for
>
table.anmeldung tr td:first-child { font-weight: bold; }
>
You might look into using the 'th' element instead though.
  #5  
Old July 8th, 2008, 02:25 PM
Bjoern Hoehrmann
Guest
 
Posts: n/a

re: Multiple selectors in rule


* Axel Siebenwirth wrote in comp.infosystems.www.authoring.stylesheets:Then you are probably using HTML where tr elements are not children of
table elements, but rather children of an often invisible tbody child,
so use

table.anmeldung tbody tr td:first-child { font-weight: bold; }
Quote:
>Also tried the same with th.
I meant as element in the markup in place of <td>.
--
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
  #6  
Old July 8th, 2008, 05:35 PM
Jonathan N. Little
Guest
 
Posts: n/a

re: Multiple selectors in rule


Bjoern Hoehrmann wrote:
Quote:
* Axel Siebenwirth wrote in comp.infosystems.www.authoring.stylesheets:>
Then you are probably using HTML where tr elements are not children of
table elements, but rather children of an often invisible tbody child,
so use
>
table.anmeldung tbody tr td:first-child { font-weight: bold; }
Rather than use the *child* selector where you must have the exact
"lineage", you know that the TD must be a descendant of the TABLE so you
can get want you want simply with the *descendant* selector:

table.anmeldung td:first-child { font-weight: bold; }

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple selectors Biguana answers 7 January 5th, 2006 12:15 PM
IE6 picks "wrong" selector? rickmorrison@gmail.com answers 2 November 8th, 2005 12:15 AM
Code Samples Delta answers 25 September 10th, 2005 07:25 PM
ID selectors: duplicated selectors Sue Sims answers 11 July 20th, 2005 09:55 PM