Forums

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

Home Forums CSS styling HTML hierarchically

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #45087
    magician11
    Participant

    How do I properly reference class and id in the HTML from the CSS code?

    For example, check out http://dev.golightlyplus.com/oliviotree/our-olive-grove/

    Say I want to set the max-width for a cell..

    What works is

    #tablepress-1 tbody td {
    max-width: 38px;
    }

    Why does it not work if I drop “tbody”?

    Or why does this not work?

    .tablepress-id-1 tbody td {
    max-width: 38px;
    }

    Thanks. I’m trying to make sure I understand the best way to style HTML hierarchically. Because in this case I don’t just want to set a max-width for “td” as I may not want this rule to apply elsewhere on the site.

    #137581
    Kitty Giraudel
    Participant

    > Why does it not work if I drop “tbody”? Or why does this not work?

    Probably a specificity issue.

    #137616
    magician11
    Participant
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.