Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS text color in table cells

Tags:

html

css

I have some (actually a lot) of tabular data. In HTML 3.2, I use HTML FONT tags to color the text within table cells (multiple colors in one cell at times) and it works fine.

Under HTML 4.01 strict, I can't (shouldn't) use FONT, because it's no longer supported. Supposed to use CSS, right? I can't use the CSS for the table cell though, because I have to account for multiple colors.

So I have some spans, for instance here is yellow on black...

<span style="text-color: #ffff00; background-color: #000000;">text-to-color</span>

However, the text appears with the page's text and background colors. Not the colors in the span. This is true in Firefox and Safari.

HTML validator says I'm not making any horrible errors.

I'm confused. Or perhaps bemused.

What am I missing here?

like image 638
fyngyrz Avatar asked Oct 19 '25 22:10

fyngyrz


1 Answers

The correct syntax is style="color:#ffff00;", not text-color.

like image 161
Stickers Avatar answered Oct 22 '25 14:10

Stickers



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!