如何在php中更改颜色

如何在php中更改颜色,php,html,mysql,css,fonts,Php,Html,Mysql,Css,Fonts,因此,我从MySQL数据库中提取usename和msg,并希望更改用户名和msg的颜色 echo "<span class='uname'>" . $extract['username'] . "</span>: <span class='msg'>" . $extract['msg'] . "</span><br>"; echo”“$提取['username']。": " . $提取['msg']。“”; echo”“$提取['us

因此,我从MySQL数据库中提取usename和msg,并希望更改用户名和msg的颜色

echo "<span class='uname'>" . $extract['username'] . "</span>: <span class='msg'>" . $extract['msg'] . "</span><br>";
echo”“$提取['username']。": " . $提取['msg']。“
”;
echo”“$提取['username']。": " . $提取['msg']。“
”;
echo”“$提取['username']。": " . $提取['msg']。“
”;
echo”“$提取['username']。": " . $提取['msg']。“
”;
echo”“$提取['username']。": " . $提取['msg']。“
”;
最好对已有的类应用CSS样式,以常规方式使用样式表,而不是使用非常规的内联样式。尽管如此,内联方法更容易。在PHP中不改变事物的颜色,而是在CSS中进行。选择您想要的颜色,获取它们的十六进制代码,然后根据您想要设置用户名和消息样式的方式将它们设置为颜色或背景色属性

.uname{
    color: #3d3; /* hex values representing Red, Green, Blue */
}
.msg{
    color: #900; /* shorthand for #990000, represents a red hue */
}
如果您无权访问页面的样式表,则可以使用
style
标记包含一个内部/页面内“样式表”,例如,将其放在文档的开头:

<style type="text/css">
.uname{
    color: #3d3; /* hex values representing Red, Green, Blue */
}
.msg{
    color: #900; /* shorthand for #990000, represents a red hue */
}
</style>

“$extract['username']”:“$extract['msg']”“
您最好对已有的类应用CSS样式,以常规方式使用样式表,而不是使用非常规的内联样式。尽管如此,内联方法更容易。在PHP中不改变事物的颜色,而是在CSS中进行。选择您想要的颜色,获取它们的十六进制代码,然后根据您想要设置用户名和消息样式的方式将它们设置为颜色或背景色属性

.uname{
    color: #3d3; /* hex values representing Red, Green, Blue */
}
.msg{
    color: #900; /* shorthand for #990000, represents a red hue */
}
如果您无权访问页面的样式表,则可以使用
style
标记包含一个内部/页面内“样式表”,例如,将其放在文档的开头:

<style type="text/css">
.uname{
    color: #3d3; /* hex values representing Red, Green, Blue */
}
.msg{
    color: #900; /* shorthand for #990000, represents a red hue */
}
</style>

“$extract['username']”:“$extract['msg']”“
您最好对已有的类应用CSS样式,以常规方式使用样式表,而不是使用非常规的内联样式。尽管如此,内联方法更容易。在PHP中不改变事物的颜色,而是在CSS中进行。选择您想要的颜色,获取它们的十六进制代码,然后根据您想要设置用户名和消息样式的方式将它们设置为颜色或背景色属性

.uname{
    color: #3d3; /* hex values representing Red, Green, Blue */
}
.msg{
    color: #900; /* shorthand for #990000, represents a red hue */
}
如果您无权访问页面的样式表,则可以使用
style
标记包含一个内部/页面内“样式表”,例如,将其放在文档的开头:

<style type="text/css">
.uname{
    color: #3d3; /* hex values representing Red, Green, Blue */
}
.msg{
    color: #900; /* shorthand for #990000, represents a red hue */
}
</style>

“$extract['username']”:“$extract['msg']”“
您最好对已有的类应用CSS样式,以常规方式使用样式表,而不是使用非常规的内联样式。尽管如此,内联方法更容易。在PHP中不改变事物的颜色,而是在CSS中进行。选择您想要的颜色,获取它们的十六进制代码,然后根据您想要设置用户名和消息样式的方式将它们设置为颜色或背景色属性

.uname{
    color: #3d3; /* hex values representing Red, Green, Blue */
}
.msg{
    color: #900; /* shorthand for #990000, represents a red hue */
}
如果您无权访问页面的样式表,则可以使用
style
标记包含一个内部/页面内“样式表”,例如,将其放在文档的开头:

<style type="text/css">
.uname{
    color: #3d3; /* hex values representing Red, Green, Blue */
}
.msg{
    color: #900; /* shorthand for #990000, represents a red hue */
}
</style>

“$extract['username']”:“$extract['msg']”“
您就快到了,只需将css添加到其中,即可完成。你面临的问题是什么?整个页面都是php,当我为css添加和标记时,它会忽略它们。你能提供代码让我们更好地理解吗?你几乎做到了,只需将css添加到页面中,就可以了。你面临的问题是什么?整个页面都是php,当我为css添加和标记时,它会忽略它们。你能提供代码让我们更好地理解吗?你几乎做到了,只需将css添加到页面中,就可以了。你面临的问题是什么?整个页面都是php,当我为css添加和标记时,它会忽略它们。你能提供代码让我们更好地理解吗?你几乎做到了,只需将css添加到页面中,就可以了。你面临什么问题?整个页面都是php,当我为css添加和标记时,它会忽略它们。你能提供代码让我们更好地理解吗