Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi Cajuna. The “.table” selector won’t work because table is an element, not a class. Your second test worked on the alternate rows, which is what you targeted. You could change the entire table background using this css:

    /* change table background to yellow */
    .entry table, .entry table tr.alt {
        background-color: #ff0;
    }

    Or you could change the odd rows by using only the “.entry table” selector, then change the alternating rows to a different color using the “.entry table tr.alt” selector.

    Thread Starter Cajuna

    (@cajuna)

    Can i put opacity only on the background and not in text?
    I’ve this at this moment:

    .entry table, .entry table tr.alt {
        background-color: #791E25;
      opacity:0.5;
    }

    Change the css to use the RGBa value instead. Note that you need to target the tr element in both cases:

    /* change table background */
    .entry table tr, .entry table tr.alt {
        background-color: rgba(121, 30, 37, 0.5)
    }

    Reference: https://css-tricks.com/rgba-browser-support/

    Thread Starter Cajuna

    (@cajuna)

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Background color table’ is closed to new replies.