Forums

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

Home Forums CSS Newbie question on universal selector

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #237878
    milk4140
    Participant

    Hello,

    I’m just starting to learn CSS and have come across some selectors that I can’t quite interpret (in CSS written by a more experienced predecessor):

    #itemid * table
    #itemid * table * th, #itemid * table * td

    Are the universal selectors functioning as wildcards for the ancestors of the various table elements here? And if so, why is a universal selector needed between table and th and table and td, respectively?

    And more importantly: how do I override this individual instances? Can I do so using a class created for the table element?

    Thanks in advance!

    #237883
    RioBrewster
    Participant

    Looks like a specificity hack to me. Why you would need that I don’t know.

    Maybe there’s an

    #itemid table

    defined somewhere else.

    And yes a class for the table should override the nested elements.

    #237885
    Shikkediel
    Participant

    I can’t the the difference with leaving the * out altogether either.

    #237906
    milk4140
    Participant

    Thank you!

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