initial-letter-align - CSS: Cascading Style Sheets 编辑

Experimental

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The initial-letter-align CSS property specifies the alignment of initial letters within a paragraph.

/* Keyword values */
initial-letter-align: auto;
initial-letter-align: alphabetic;
initial-letter-align: hanging;
initial-letter-align: ideographic;

/* Global values */
initial-letter-align: inherit;
initial-letter-align: initial;
initial-letter-align: unset;

Syntax

One of the keyword values listed below.

Values

auto
The user agent selects the value which corresponds to the language of the text. Western languages would default to alphabetic, CJK languages to ideographic, and some Indic languages to hanging.
alphabetic
As described above, the cap height of the initial letter aligns with the cap height of the first line of text. The baseline of the initial letter aligns with the baseline of the Nth text baseline.
hanging
The hanging baseline of the initial letter aligns with the hanging baseline of the first line of text.
ideographic
The initial letter is centered in the N-line area.

Formal definition

Initial valueauto
Applies to::first-letter pseudo-elements and inline-level first child of a block container
Inheritedno
Computed valueas specified
Animation typediscrete

Formal syntax

[ auto | alphabetic | hanging | ideographic ]

Examples

Aligning initial letter

HTML

<p class="auto ">Initial letter - auto</p>
<p class="alphabetic">Initial letter - alphabetic</p>
<p class="hanging">Initial letter - hanging</p>
<p class="ideographic">Initial letter - ideographic</p>

CSS

.auto {
  -webkit-initial-letter-align: auto;
  initial-letter-align: auto;
}

.alphabetic {
  -webkit-initial-letter-align: alphabetic;
  initial-letter-align: alphabetic;
}

.hanging {
  -webkit-initial-letter-align: hanging;
  initial-letter-align: hanging;
}

.ideographic {
  -webkit-initial-letter-align: ideographic;
  initial-letter-align: ideographic;
}

Result

Specifications

SpecificationStatusComment
CSS Inline Layout
The definition of 'initial-letter-align' in that specification.
Working DraftInitial definition

Browser compatibility

BCD tables only load in the browser

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:59 次

字数:5684

最后编辑:7 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文