--- title: font-variant-ligatures slug: Web/CSS/font-variant-ligatures translation_of: Web/CSS/font-variant-ligatures ---
font-variant-ligatures
属性控制着其所应用元素文本的 {{Glossary("ligature", "ligatures")}} 与 {{Glossary("contextual forms")}} 。 会使文字最终的表现形式更加统一。
/* Keyword values */ font-variant-ligatures: normal; font-variant-ligatures: none; font-variant-ligatures: common-ligatures; /* <common-lig-values> */ font-variant-ligatures: no-common-ligatures; /* <common-lig-values> */ font-variant-ligatures: discretionary-ligatures; /* <discretionary-lig-values> */ font-variant-ligatures: no-discretionary-ligatures; /* <discretionary-lig-values> */ font-variant-ligatures: historical-ligatures; /* <historical-lig-values> */ font-variant-ligatures: no-historical-ligatures; /* <historical-lig-values> */ font-variant-ligatures: contextual; /* <contextual-alt-values> */ font-variant-ligatures: no-contextual; /* <contextual-alt-values> */ /* Global values */ font-variant-ligatures: inherit; font-variant-ligatures: initial; font-variant-ligatures: unset;
font-variant-ligatures
取值为下列关键字之一。
normal
none
fi
, ffi
, th
or similar. They correspond to the OpenType values liga
and clig
. Two values are possible:
common-ligatures
activating these ligatures. Note that the keyword normal
activates these ligatures.no-common-ligatures
deactivating these ligatures.dlig
. Two values are possible:
discretionary-ligatures
activating these ligatures.no-discretionary-ligatures
deactivating the ligatures. Note that the keyword normal
usually deactivates these ligatures.hlig
. Two values are possible:
historical-ligatures
activating these ligatures.no-historical-ligatures
deactivating the ligatures. Note that the keyword normal
usually deactivates these ligatures.calt
. Two values are possible:
contextual
specifies that the contextual alternates are to be used. Note that the keyword normal
usually activates these ligatures too.no-contextual
prevents their use.{{cssinfo}}
<link href="//fonts.googleapis.com/css?family=Lora" rel="stylesheet"> <p class="normal"> normal<br> if fi ff tf ft jf fj </p> <p class="none"> none<br> if fi ff tf ft jf fj </p> <p class="common-ligatures"> common-ligatures<br> if fi ff tf ft jf fj </p> <p class="no-common-ligatures"> no-common-ligatures<br> if fi ff tf ft jf fj </p> <p class="discretionary-ligatures"> discretionary-ligatures<br> if fi ff tf ft jf fj </p> <p class="no-discretionary-ligatures"> no-discretionary-ligatures<br> if fi ff tf ft jf fj </p> <p class="historical-ligatures"> historical-ligatures<br> if fi ff tf ft jf fj </p> <p class="no-historical-ligatures"> no-historical-ligatures<br> if fi ff tf ft jf fj </p> <p class="contextual"> contextual<br> if fi ff tf ft jf fj </p> <p class="no-contextual"> no-contextual<br> if fi ff tf ft jf fj </p> <p class="contextual"> contextual<br> if fi ff tf ft jf fj </p>
p { font-family: Lora, serif; } .normal { font-variant-ligatures: normal; } .none { font-variant-ligatures: none; } .common-ligatures { font-variant-ligatures: common-ligatures; } .no-common-ligatures { font-variant-ligatures: no-common-ligatures; } .discretionary-ligatures { font-variant-ligatures: discretionary-ligatures; } .no-discretionary-ligatures { font-variant-ligatures: no-discretionary-ligatures; } .historical-ligatures { font-variant-ligatures: historical-ligatures; } .no-historical-ligatures { font-variant-ligatures: no-historical-ligatures; } .contextual { font-variant-ligatures: contextual; } .no-contextual { font-variant-ligatures: no-contextual; } .contextual { font-variant-ligatures: contextual; }
{{ EmbedLiveSample('Setting_font_ligatures_and_contextual_forms', '', '700', '', 'Web/CSS/font-variant-ligatures') }}
Specification | Status | Comment |
---|---|---|
{{SpecName('CSS3 Fonts', '#propdef-font-variant-ligatures', 'font-variant-ligatures')}} | {{Spec2('CSS3 Fonts')}} | Initial definition |
{{Compat("css.properties.font-variant-ligatures")}}