0

I have some <td></td> elements as shown below.

<td class='2'>Hello</td>
<td class='3'>World</td>

I need to add style to this <td> by calling the class. I have tried as below, but no changes are taking place.

<style>
.2, .3 {
    background-color: green;
}
</style>

I don't want to use id attribute. I know that something is missing here, but can't quite figure it out!

1 Answers1

1

CSS classes starting with numbers won't work, if that's what you actually do. Use words instead (letters a-z), underscores(_) and hyphens (-) only.

anatolhiman
  • 1,762
  • 2
  • 14
  • 23