P標籤中的文字如何設定成多種顏色
- 2021-10-08
方法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屬性和值。
沒有這樣的,必須再加入標籤一般的寫法如
魂牽夢縈扔你你你你
魂牽夢縈 扔你你你你
然後在css中加上規則:#red {color:red;}#yellow {color :yellow;}魂牽夢縈
扔你你你你
style=“word-wrap: break-word;”
上一篇:違章拍照拍測速嗎?
下一篇:5D Mark2第一個鏡頭推薦