Html 如何使用字体颜色html
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3879646/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to use the font color html
提问by tintincutes
i would like to use the font color here. but seems don't know where to put the code for :
我想在这里使用字体颜色。但似乎不知道将代码放在哪里:
<html>
<tr>
<td style="padding-left: 5px;"> 11.15 - 12.00 </td>
<td style="padding-left: 5px; padding-bottom:3px;"> <b> TEST </b><br/></td>
</tr>
</html>
回答by Matt Ellen
To set the font colour, just set the color attribute in the style:
要设置字体颜色,只需在样式中设置颜色属性:
<table>
<tr>
<td style="padding-left: 5px;
padding-bottom:3px;
color:#FF0000;
font-weight:bold">TEST</td>
</tr>
</table>
This will render the word TEST in red.
这将使 TEST 一词变为红色。
回答by JoshD
<html>
<tr>
<td style="padding-left: 5px; color: blue;"> 11.15 - 12.00 </td>
<td style="padding-left: 5px; padding-bottom:3px; color: green;"> <b> TEST </b><br/></td>
</tr>
</html>
回答by VijayS91
Use the Css style sheet:
使用 CSS 样式表:
<style>
.a td{
padding-left: 5px;
padding-bottom:3px;
color: blue;
}
</style>
<table class="a">
<tr>
<td >TEST</td>
</tr>
</table>
回答by Javasist
i didn't Found body tag in your Code neither was table tag..so here is correct code...as per your requirements
我没有在你的代码中找到 body 标签,也没有找到 table 标签......所以这里是正确的代码......根据你的要求
<html>
<body>
<table>
<tr>
<td style="padding-left: 5px;color:red"> 11.15 - 12.00 </td>
<td style="padding-left: 5px; padding-bottom:3px;"><b> TEST </b><br/></td>
</tr>
</table>
</body>
</html>