Question: How to change font color and size in HTML? Steps: Font color: Set the font color using the <font> tag or the CSS color property. Font size: Use the <font> tag to set the font size (1-7), or use the CSS font-size property to set a pixel or relative size.
Modify font color and size in HTML
Change font color
Set the font color using the <font>
tag:
<code class="html"><font color="red">这是红色的文本</font></code>
You can use the color
property of CSS instead of the <font>
tag :
<code class="html"><span style="color: red">这是红色的文本</span></code>
Change font size
Use the <font>
tag to set the font size:
<code class="html"><font size="5">这是5号字体</font></code>
where, the size value Can range from 1 to 7, where 1 is the smallest and 7 is the largest.
You can also use the font-size
property of CSS to set the font size:
<code class="html"><span style="font-size: 20px">这是20像素的字体</span></code>
Note:
<font>
tag is deprecated as it is obsolete in modern HTML standards. It is recommended to use CSS. <font>
tag has been removed from HTML5. The above is the detailed content of How to change font color size in html. For more information, please follow other related articles on the PHP Chinese website!