Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何设置文本颜色?_Html_Css_Textcolor - Fatal编程技术网

Html 如何设置文本颜色?

Html 如何设置文本颜色?,html,css,textcolor,Html,Css,Textcolor,标题解释了这一切,请注意,我只是用谷歌搜索一下,但由于某种原因,我的电脑现在很难连接到互联网,所以我不得不用非常糟糕的网络格式在手机上写下这篇文章 编辑:现在在真正的计算机上,为了澄清这一点,我需要在HTML文档中设置字符串的文本颜色,最好是通过CSS。简单点,像这样: 单词RED应该是红色的! 在我发布这篇文章的时候,我没能尝试太多,因为我的电脑有网络故障,所以我真的不知道该怎么办。试试这个 <span style="color: yourColor">your tex

标题解释了这一切,请注意,我只是用谷歌搜索一下,但由于某种原因,我的电脑现在很难连接到互联网,所以我不得不用非常糟糕的网络格式在手机上写下这篇文章

编辑:现在在真正的计算机上,为了澄清这一点,我需要在HTML文档中设置字符串的文本颜色,最好是通过CSS。简单点,像这样:




单词
RED
应该是红色的!

在我发布这篇文章的时候,我没能尝试太多,因为我的电脑有网络故障,所以我真的不知道该怎么办。

试试这个

 <span style="color: yourColor">your text</span>
您的文本
类似于css中的内联样式

<p style="color: blue"> text here </p>
然后将类添加到元素中

<p class="textColor"> text here </p>

此处的文本

您可以使用此

<font color='red' >your text here</font>
此处显示您的文本
通过此选项,您可以为us文本设置所需的颜色。您也可以在此处使用十六进制格式。

在html中

.attention{
   color:red;
}
在您的css文件中,例如,包含在html头部的my_styles.css,例如

<head>
    <link rel="stylesheet" type="text/css" href="my_styles.css">
</head>
在您的css文件中,
标记已被删除,并且与HTML5完全不兼容。使用是一种方式。
<font color='red' >your text here</font>
.attention{
   color:red;
}
<head>
    <link rel="stylesheet" type="text/css" href="my_styles.css">
</head>
#attention{
   color:red;
}