P标签中的文字如何设置成多种颜色

2025-02-25 18:23:19
推荐回答(5个)
回答1:

方法1、

<div class="contain">

<p style="font-size:30px;color:orange">p标签设置字体颜色</p>

</div>

方法2、

<style>

.contain p{

font-size:30px;

color:orange;

}

</style>

<div class="contain">

<p>p标签设置字体颜色1</p>

</div>

扩展资料:

在HTML文档中使用style属性:

<h1 style="color:blue;text-align:center">This is a header</h1>

<p style="color:red">This is a paragraph.</p>

定义和用法

style属性规定元素的行内样式(inline style)

style属性将覆盖任何全局的样式设定,例如在<style>标签或在外部样式表中规定的样式。

语法

<element style="value">

属性值

值:style_definition;

描述:一个或多个由分号分隔的CSS属性和值。

回答2:

没有这样的,必须再加入标签一般的写法如

魂牵梦萦扔你你你你

回答3:

魂牵梦萦 扔你你你你

然后在css中加上规则:#red {color:red;}#yellow {color :yellow;}

回答4:

重载OnDrawItem,OnErase.

回答5:

style="word-wrap: break-word;"