change font color in certain td

liunx

Guest
i want to change the color of a text in a certain <TD> in a table<br />
and dont change the color in all of the other scells<br />
how do i do that?<br />
<br />
and what if i want to change only ppart of the text in that cell???<br />
for example :<br />
the data is based on <red>the time of<red>.....<br />
<br />
<br />
thnaks in advance<br />
peleg<!--content--><td style="color:red;">The text in the cell is red</td><br />
<br />
If you want to change the text of a set of cells, like say one column in a table, you would do this<br />
<br />
put this in your head<br />
<br />
<style tyle="text/css"><br />
.red {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;color:red;<br />
}<br />
</style><br />
<br />
This is the cell<br />
<br />
<td class="red">This text is red</td><br />
<td>This text is not red</td><br />
<td class="red">But here is another red cell!</td><br />
<br />
I am using css to do this.<br />
<br />
To change just a few words you would say <br />
<br />
<span class="red">This text is red, it is using the red class up in our stlye sheet in the head section</span><br />
<br />
Or<br />
<br />
<style type="color:red;">red text, style attribute, css right with the element</style><br />
<br />
You can also use an id, that differs from a class in that with an id it goes in a style sheet but it uses a # instead of a . and the id will apply to one element only and cannot apply to several elements. Obviously to make a paragraph of text red you would just use the same class, id, or style attribute on the <p> element. To make all paragraphs red or all spans red or whatever you could say<br />
<br />
p {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;color:red;<br />
}<br />
<br />
And that in a nut shell is how to apply font colors through css, you can apply border to elements, and even position elements much the same way. Infact idealy your whole layout would be made using code like this instead of a table, frames, or image map.<!--content-->:):):):)<!--content-->no problem :D<!--content-->
 
Back
Top