在本文中,我們將討論 CSS 中的 text-emphasis 屬性。它是 text-emphasis-style 和 text-emphasis-color 的 short-hand 屬性。它將強調屬性應用於字符(空格和控製字符除外)。
用法:
text-emphasis:text-emphasis-style text-emphasis-color;
屬性:
- text-emphasis-style:它定義了強調標記的形狀。它接受諸如填充、開放、點、三角形、無等值。
- text-emphasis-color:它定義了強調標記的顏色。
例:
HTML
<!DOCTYPE html>
<html>
<head>
<style>
h2 {
text-emphasis:filled double-circle green;
-webkit-text-emphasis:filled double-circle green;
}
</style>
<title>Text Emphasis</title>
</head>
<body>
<center>
<h2>Welcome to GFG</h2>
</center>
</body>
</html>
輸出:
支持的瀏覽器:
- chrome 25 及以上
- Edge 79 及以上
- 火狐 46 及以上
- Opera 15 及以上
- Safari 7 及更高版本
相關用法
- CSS transition-property用法及代碼示例
- CSS table-layout用法及代碼示例
- CSS text-align用法及代碼示例
- CSS border-top-width用法及代碼示例
- CSS isolation屬性用法及代碼示例
- CSS border-inline-start-style屬性用法及代碼示例
- CSS column-rule-width用法及代碼示例
- CSS word-spacing用法及代碼示例
- CSS animation-delay用法及代碼示例
- CSS margin-top用法及代碼示例
- CSS grid屬性用法及代碼示例
- CSS font-size-adjust用法及代碼示例
- CSS visibility屬性用法及代碼示例
- CSS Display屬性用法及代碼示例
- CSS grid-template-columns用法及代碼示例
- CSS height屬性用法及代碼示例
- CSS transform-origin用法及代碼示例
注:本文由純淨天空篩選整理自kankshi25大神的英文原創作品 CSS text-emphasis Property。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。