CSS font-variant-ligatures屬性用於控製文本字體的連字。連字是將兩個或多個字符組合為一個特殊字符。連字通常用於賦予文本某些樣式或外觀。
用法:
font-variant-ligatures:Keyword_values
或者
font-variant-ligatures:Global_values
屬性值:該屬性接受上麵提到的和下麵描述的屬性值。
- Keyword_values:該屬性值是指由“normal”,“none”,“common-ligatures”,“no-common-ligatures”,“discretionary-ligatures”,“no-discretionary-ligatures”,“historical-ligatures”,“no-historical-ligatures”,“contextual”,“no-contextual”定義的值。
- Global_values:該屬性值是指由“inherit”,“initial”,“unset”定義的值。
範例1:下麵的示例說明了使用common-ligatures和no-common-ligatures的font-variant-ligatures屬性的使用。
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<style>
div {
font-size:5vw;
}
.off {
font-variant-ligatures:no-common-ligatures;
color:rgb(83, 241, 21);
}
.on {
font-variant-ligatures:common-ligatures;
color:rgb(96, 153, 4);
}
</style>
</head>
<body>
<h1 style="color:green;">GeeksforGeeks</h1>
<div>
<span class="off">wifi</span>
<span class="on">wifi</span>
</div>
</body>
</html>
輸出:
支持的瀏覽器:
- Chrome
- Firefox
- Safari
- Opera
- Edge
- Internet Explorer(不支持)。
相關用法
- 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 grid-template-columns用法及代碼示例
- CSS height屬性用法及代碼示例
- CSS transform-origin用法及代碼示例
- CSS animation-name用法及代碼示例
- CSS flex-wrap用法及代碼示例
- CSS align-content用法及代碼示例
- CSS page-break-before屬性用法及代碼示例
- CSS empty-cells用法及代碼示例
注:本文由純淨天空篩選整理自thacker_shahid大神的英文原創作品 CSS font-variant-ligatures Property。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。