Bogdan Mihai Bogdan Mihai - 1 month ago 8
CSS Question

Can I set a predefined text content of a table cell in a CSS class?

I tried this:

<style type="text/css">
td.orange : before { background: #DD5F15; content : "TRIPLE";}
</style>


But I believe it adds the content provided after the closing "td" tag, which is why it doesn't show up.
Basically, I just want all the "orange" table cells to just have the text "TRIBLE" inside them.

Answer

You have

td.orange : before { background: #DD5F15; content : "TRIPLE";}

Try this (remove spaces before and after of colon : )

td.orange:before { background: #DD5F15; content : "TRIPLE";}‚Äč

Working Example.