語法
css
text-justify: none;
text-justify: auto;
text-justify: inter-word;
text-justify: inter-character;
text-justify: distribute; /* Deprecated value */
/* Global values */
text-justify: inherit;
text-justify: initial;
text-justify: revert;
text-justify: revert-layer;
text-justify: unset;
值
none-
文字對齊功能已關閉。這與完全不設定
text-align具有相同的效果,儘管如果您出於某種原因需要開啟和關閉對齊功能,這會很有用。 auto-
瀏覽器根據效能和質量之間的平衡,以及文字語言(例如,英語、CJK 語言等)最適合的方式,選擇當前情況的最佳對齊方式。這是在未設定
text-justify時使用的預設對齊方式。 單詞間-
透過在單詞之間新增空格(有效地改變
word-spacing)來對齊文字,這最適用於使用空格分隔單詞的語言,例如英語或韓語。 字元間-
透過在字元之間新增空格(有效地改變
letter-spacing)來對齊文字,這最適用於日語等語言。 分配-
與
inter-character表現相同;此值是為了向後相容而保留的。
正式定義
正式語法
text-justify =
[ auto | none | inter-word | inter-character | ruby ] ||
no-compress
示例
text-justify 不同值的演示
css
p {
font-size: 1.5em;
border: 1px solid black;
padding: 10px;
width: 95%;
margin: 10px auto;
text-align: justify;
}
.none {
text-justify: none;
}
.auto {
text-justify: auto;
}
.dist {
text-justify: distribute;
}
.word {
text-justify: inter-word;
}
.char {
text-justify: inter-character;
}
規範
| 規範 |
|---|
| CSS Text Module Level 3 # text-justify 屬性 |
瀏覽器相容性
載入中…