試一試
text-emphasis-color: currentColor;
text-emphasis-color: red;
text-emphasis-color: rgb(90 200 160 / 0.8);
<section id="default-example">
<p>
I'd far rather be
<span class="transition-all" id="example-element">happy than right</span>
any day.
</p>
</section>
p {
font: 1.5em sans-serif;
}
#example-element {
text-emphasis: filled;
}
語法
css
/* Initial value */
text-emphasis-color: currentColor;
/* <color> */
text-emphasis-color: #555555;
text-emphasis-color: blue;
text-emphasis-color: rgb(90 200 160 / 80%);
text-emphasis-color: transparent;
/* Global values */
text-emphasis-color: inherit;
text-emphasis-color: initial;
text-emphasis-color: revert;
text-emphasis-color: revert-layer;
text-emphasis-color: unset;
值
<color>-
定義著重號的顏色。如果未指定顏色,則預設為
currentColor。
正式定義
正式語法
text-emphasis-color =
<color>
示例
帶有顏色和自定義字元的著重號
CSS
css
em {
text-emphasis-color: green;
text-emphasis-style: "*";
}
HTML
html
<p>Here's an example:</p>
<em>This has emphasis marks!</em>
結果
規範
| 規範 |
|---|
| CSS 文字裝飾模組級別 3 # text-emphasis-color 屬性 |
瀏覽器相容性
載入中…
另見
<color>資料型別- 其他著重號相關屬性:
text-emphasis-style、text-emphasis和text-emphasis-position。 - 其他顏色相關屬性:
color、background-color、border-color、outline-color、text-shadow、caret-color和column-rule-color