首字 | initial-letter (Inline Layout)

  •   CSS 中文开发手册

    首字 | initial-letter (Inline Layout) - CSS 中文开发手册

    这是一种实验技术

    由于该技术的规格不稳定,请查看各种浏览器的兼容性表格以供使用。另外请注意,随着规范的变化,实验技术的语法和行为在未来版本的浏览器中可能会发生变化。

    initial-letter属性指定下跌,上升,下沉和首字母造型。

    /* Keyword values */
    initial-letter: normal;
    
    /* Numeric values */
    initial-letter: 1.5;    /* Initial letter occupies 1.5 lines */
    initial-letter: 3.0;    /* Initial letter occupies 3 lines */
    initial-letter: 3.0 2;  /* Initial letter occupies 3 lines and
                               sinks 2 lines */
    
    /* Global values */
    initial-letter: inherit;
    initial-letter: initial;
    initial-letter: unset;

    初始值

    normal

    应用于

    ::first-letter pseudo-elements and inline-level first child of a block container

    是否继承

    no

    适用媒体

    visual

    计算值

    as specified

    Animation type

    discrete

    规范顺序

    the unique non-ambiguous order defined by the formal grammar

    句法

    关键字值normal,或<number>可选的后面跟一个<integer>。

    价值

    normal没有特别的首字母效果。文本行为正常。

    <number>根据占用的行数来定义首字母的大小。负值是不允许的。

    <integer>定义初始字母在给定大小时应该下沉的行数。值必须大于零。如果省略,则复制大小值,并将其定位到最接近的正整数。

    形式语法

    normal | [ <number> <integer>? ]

    CSS内容

    .normal {
      initial-letter: normal;
    }
    
    .onefive {
      initial-letter: 1.5;
    }
    
    .three {
      initial-letter: 3.0;
    }

    HTML内容

    <p class="normal">Initial letter is normal</p>
    <p class="onefive">Initial letter occupies 1.5 lines</p>
    <p class="three">Initial letter occupies 3 lines</p>

    输出量

    规格

    Specification

    Status

    Comment

    CSS Inline LayoutThe definition of 'initial-letter' in that specification.

    Working Draft

    Initial definition

    浏览器兼容性

    Feature

    Chrome

    Firefox (Gecko)

    Internet Explorer

    Opera

    Safari

    Basic support

    No support

    No support1

    No support

    No support

    AppleWebKit/603

    Feature

    Android

    Firefox Mobile (Gecko)

    IE Mobile

    Opera Mobile

    Safari Mobile

    Basic support

    No support

    No support1

    No support

    No support

    No support

  •   CSS 中文开发手册
    转载请保留页面地址:https://www.breakyizhan.com/css/32469.html
    原文地址:https://www.cnblogs.com/breakyizhan/p/13234154.html