Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 8th, 2008, 12:25 PM
Axel Siebenwirth
Guest
 
Posts: n/a
Default Multiple selectors in rule

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
Default 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
Default 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
Default 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
Default 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
Default 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
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles