當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


CSS text-emphasis屬性用法及代碼示例

在本文中,我們將討論 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 及更高版本

相關用法


注:本文由純淨天空篩選整理自kankshi25大神的英文原創作品 CSS text-emphasis Property。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。