Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS CSS Targeting the tr of a td

  • This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #35207
    sly
    Participant

    Hi,

    I have a

    and want to target the

    so I can change the background color of the whole row. Is there a way that I can select the table row via the td class 123?

    Thanks,

    Simon.

    #90810
    tobeeornot
    Member

    why don’t you just set a class or id for the tr?

    #90811
    Mottie
    Member

    In a word, “no”… you can read more about it here.

    #90812
    sly
    Participant

    hi, the code is generated by a cms not me, so I can’t see a way of adding a class to the tr.

    #90819
    tobeeornot
    Member

    Depends on your user access to the code, but read Mottie’s link because that is correct.

    #90830
    sly
    Participant

    Thanks people!

    CSS4 should be out next week shouldn’t it? ;)

    #90842
    TheDoc
    Member

    Yea, it’s a shame that it’s not currently possible. It’d be an unbelievably useful property.

    #90874

    @TheDoc Agreed, but I am worried about how much it could slow down the loading of stylesheets. CSS wasn’t really designed with targeting parent elements in mind. I guess we will find out when browsers start using CSS4 properties!

    #90930
    TheDoc
    Member

    @joshuanhibbert Totally, but I’d rather do that than have to fire up some JS to add a class to the parent (see: WordPress menus).

Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘CSS’ is closed to new topics and replies.