0

How to add background color to cell when i have this html?

<td><div class="color">RED</div></td>

I want to add background color to td but i dont want to add class or ID to that td, is it possible to that like .color:before

Schneider
  • 2,446
  • 6
  • 28
  • 38
  • we have `:before` but looks like you misunderstand its usage. – King King May 18 '14 at 16:22
  • If your question is about laying a color over the parent's element , then the pseudo-element is a way to do so : http://codepen.io/gc-nomade/pen/exGJF . If this is your question and answer , then reformulate the question to ropen it. i'll add then this as an answer. – G-Cyrillus May 18 '14 at 18:17

0 Answers0