Sois
Sois

Reputation: 33

Set table data color in CSS file

When setting the color of a table data field with this

<td class='td_7_1' style='background-color: #FA58F4' >Hallo</td>

it is working.

But when I use this

<td class='td_7_1' >Hallo</td>

and place this in my CSS file

td.td_7_1
{
width : 15%;
background-color: : #FA58F4;
}

it is not working (and yes, my CSS file is linked with this):

<link href="overzicht.css" rel="stylesheet" type="text/css" />

Any help is welcome!

Upvotes: 0

Views: 287

Answers (4)

Awaissoft
Awaissoft

Reputation: 41

change your css code

.td_7_1
{
width : 15%;
background-color: #FA58F4;
}

Upvotes: 0

Matas Vaitkevicius
Matas Vaitkevicius

Reputation: 61409

You have a typo

td.td_7_1
{
width : 15%;
background-color: #FA58F4;
}

Upvotes: 0

Sowmya
Sowmya

Reputation: 26969

Remove an extra : from css

background-color:  #FA58F4;

Demo

Upvotes: 3

Robban
Robban

Reputation: 6802

Your css has two :

Change it to:

td.td_7_1
{
width : 15%;
background-color: #FA58F4;
}

Upvotes: 0

Related Questions