![html字体颜色怎么设置](https://img.php.cn/upload/article/000/000/039/5e5dc83cb75b3462.jpg)
html可以使用“color”属性设置字体颜色。
推荐学习:html入门教程
1、新建html文档,在body标签中添加p标签,然后在p标签中添加一些文字:
![1583204280532570.jpg 1.jpg](https://img.php.cn/upload/image/553/688/844/1583204280532570.jpg)
2、在head标签中添加style标签,style标签的作用是为元素添加样式,然后在style标签中添加“p{ }”,p指的是为所有p标签设置样式,大括号内填写样式内容:
![1583204302214898.jpg 2.jpg](https://img.php.cn/upload/image/564/723/132/1583204302214898.jpg)
3、在大括号内添加“color”属性,属性值为文本颜色,这时字体就被添加上了颜色:
![1583204323973550.jpg 3.jpg](https://img.php.cn/upload/image/161/132/372/1583204323973550.jpg)
PHP中文网,大量PHP教程及网站建设教程,欢迎学习!
以上是html字体颜色怎么设置的详细内容。更多信息请关注PHP中文网其他相关文章!