-
-
Save kobitoDevelopment/7fc572c01478fcfb29965e32483e0be3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 省略記号(…)だけに特定のフォント(Arial)を適用するためのフォント定義 */ | |
@font-face { | |
font-family: 'ellipsis'; /* フォントファミリー名を "ellipsis" とする */ | |
src: local("Arial"); /* ローカルの Arial フォントを使用 */ | |
unicode-range: U+2026; /* Unicode 2026(…)だけをこのフォントで描画 */ | |
} | |
div { | |
width: 200px; | |
text-overflow: ellipsis; /* コンテンツがオーバーしたら "…" を表示 */ | |
overflow: hidden; | |
white-space: nowrap; | |
/* | |
フォントファミリーの優先順位を指定。 | |
"ellipsis" は省略記号(…)だけに適用され、それ以外の文字は次のフォントにフォールバック。 | |
これにより、テキストは和文フォントで表示されつつ、 | |
自動で追加される省略記号だけが欧文フォント(Arial)で表示される。 | |
*/ | |
font-family: ellipsis, sans-serif; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
sample sample sample sample sample sample sample sample sample | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment