CSS initial-letter attribute
- Previous Page @import
- Next Page inline-size
Definition and usage
initial-letter
The attribute specifies the size of the first letter, and optionally specifies the number of lines the first letter should drop (downward in the text).
This property applies to :first-letter
The first inline-level child of a pseudo-element and a block-level container.
Example
Display first letters of different sizes:
.normal::first-letter { -webkit-initial-letter: normal; initial-letter: normal; } .two::first-letter { -webkit-initial-letter: 2; initial-letter: 2; /* The first letter occupies 2 lines */ } .four::first-letter { -webkit-initial-letter: 4; initial-letter: 4; /* The first letter occupies 4 lines */ } .four2::first-letter { -webkit-initial-letter: 4 2; initial-letter: 4 2; /* The first letter occupies 4 lines and drops 2 lines */ }
CSS syntax
initial-letter: normal|number|integer;
Attribute value
Value | Description |
---|---|
normal | Default value. No effect. Text appears normally. |
number | Sets the size of the first letter (the number of lines the first letter should span). |
integer | Optional. Sets the number of lines for the first letter to be dropped (in the text). |
Technical details
Default value: | normal |
---|---|
Inheritance: | No |
Animation production: | Not supported. See also:Animation-related properties. |
Version: | CSS3 |
Browser support
The numbers in the table specify the first browser version that fully supports this property.
The -webkit- prefix following the number specifies the first working version with the prefix.
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
110.0 | 110.0 | Not Supported | 9.0 -webkit- | 96.0 |
- Previous Page @import
- Next Page inline-size