简体   繁体   English

当我设置了通用字体颜色时,如何更改文本颜色?

[英]How do I change text color when I have a universal font color set?

How do I change the text color for a specific piece of text when I have a text color set inside the body tag.当我在正文标签内设置了文本颜色时,如何更改特定文本的文本颜色。 It doesn't seem to work.它似乎不起作用。 Am I doing something wrong or is there a better way of going around this?我做错了什么还是有更好的方法来解决这个问题?

 <body style="background-color: black; color: white"> <p>Hello!</p>

Hope this wasn't confusing as I am not the best at explaining things!希望这不会令人困惑,因为我不是最擅长解释的事情!

If I understood your question right, you want to change the color of the "Hello,"?如果我理解你的问题,你想改变“你好”的颜色吗? but not the rest of the body, If so: you can just use a seperate style for the p tag:但不是身体的 rest,如果是这样:您可以为 p 标签使用单独的样式:

<p style="color: red">Hello!</p>

Sorry, if I didn't understand the question properly.对不起,如果我没有正确理解这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM