background color | SoloLearn: Learn to code for FREE!

+1

background color

I am new to learning coding and need some help when i used this: <!DOCTYPE html> <html> <head> <title>first page</title> </head> <body> <table border=”2”> <tr> <td bgcolor=”red”>red</td> <td>blue</td> <td>green</td> </tr> </table> </body> </html> the background color is green, not red.

1/18/2017 3:13:16 PM

Melissa Harris

4 Answers

New Answer

+4

So... dont USE ” You should use normal, programming quotes. Like these: " Also customization is not supported in html5 anymore Fixed version of code xD <!DOCTYPE html> <html> <head> <title>first page</title> </head> <body> <table border="2"> <tr> <td bgcolor="red">red</td> <td>blue</td> <td>green</td> </tr> </table> </body>

0

try <td bgcolor="#FF0000" >red</td>

-1

yes.. go with either bgcolor="#ff0000" or bgcolor="#f00" both are the same. It is called hexadecimal color code and you can make any color with it. It is basically mixing the 3 color channels and 'f' fully opens that channel while '0' entirely closes the color channel. The channels are Red, Green and Blue (RGB). As you can see in the hexadecimal for red ff0000 ... ff (red) 00 (green) 00 (blue) the Red channel is open (ff) and the Green and Blue are closed (00). so Green would be "#00ff00" or "#0f0" and Blue would be "#0000ff" or "#00f" Every channel has 2 values between 0 to 9 and a to f. Try and play some with it.... it is awesome!