Why wont the colors show in my code ?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-...
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled</title>
<style type="text/css">
.color1 {color: red;}
.color2 { color: blue;}
</style>
</head>
<body>
<table border="3" width="50%" cellpadding ="30">
<tr>
<td class="color1"> </td>
<td> </td>
<td> </td>
<td class="color2"> </td>
</tr>
<tr>
<td> </td>
<td class="color1"> </td>
<td class="color2"> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td class="color2"> </td>
<td class="color1"> </td>
<td > </td>
</tr>
<tr>
<td class="color2"> </td>
<td> </td>
<td> </td>
<td class="color1"> </td>
</tr>
</table>
</body>
</html>
Other Answers:
Simple! There is no text in the cells you denote to be color1 or color2. Place words there instead of a white space.
Try something like this:
...
<tr>
<td class="color2">Foo</td>
<td> </td>
<td> </td>
<td class="color1">Bar</td>
</tr>
...
Good luck to you!
Try something like this:
...
<tr>
<td class="color2">Foo</td>
<td> </td>
<td> </td>
<td class="color1">Bar</td>
</tr>
...
Good luck to you!
If you're trying to get the table cells to look like filled in rectangles of color, you need to set the "background-color" property in your CSS. The "color" property only affects the text in an element.
0 коммент.:
Post a Comment