initial-letter is a CSS property that selects the first letter of the element where it is applied and specifies the number of lines the letter occupies.. You may have seen something like this on news sites, where the first letter of a leading paragraph is larger than the rest of the content. The letter-spacing CSS property sets the horizontal spacing behavior between text characters.
CSS letter-spacing Property.
The ::first-letter selector is used to add a style to the first letter of the specified selector.. Examples might be simplified to improve reading and basic understanding. The letter-spacing property sets the extra spacing between the letters of an element's text.. Positive values of letter-spacing causes characters to spread farther apart, while negative values of letter-spacing bring characters closer together. The letter-spacing property increases or decreases the space between characters in a text.
If you'd like to contribute to the data, please check out Topic: CSS3 Properties Reference Prev|Next Description. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content.
Definition and Usage. Sign in to enjoy the benefits of an MDN account.
The ::first-letter CSS pseudo-element applies styles to the first letter of the first line of a block-level element, but only when not preceded by other content (such as images or inline tables).
This solution is a pretty good fix, but if you want to have text-align: center another option that builds on this idea is to instead set margin-left to .5 * letter-spacing (.6em in the above example) and margin-right to -.5 * letter-spacing (-.6em for the above example -- note the right-margin is a negative value). /* Selects the first letter of a
*/ p::first-letter { font-size: 130%; } The first letter … This value is added to the natural spacing between characters while rendering the text. While using this site, you agree to have read and accepted our Set the letter spacing for
, , and elements:The numbers in the table specify the first browser version that fully supports the property.If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:
The letter-spacing property controls the amount of space between each letter in a given element or block of text. letter-spacing 属性增加或减少字符间的空白(字符间距)。 该属性定义了在文本字符框之间插入多少空间。由于字符字形通常比其字符框要窄,指定长度值时,会调整字母之间通常的间隔。因此,normal 就相 … If you haven’t already created an account, you will be prompted to do so after signing in.
elements:The numbers in the table specify the first browser version that fully supports the property.If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail: The letter-spacing property controls the amount of space between each letter in a given element or block of text. letter-spacing 属性增加或减少字符间的空白(字符间距)。 该属性定义了在文本字符框之间插入多少空间。由于字符字形通常比其字符框要窄,指定长度值时,会调整字母之间通常的间隔。因此,normal 就相 … If you haven’t already created an account, you will be prompted to do so after signing in.
The following table summarizes the usages context and the version history of this property.
W3Schools is optimized for learning, testing, and training. The compatibility table on this page is generated from structured data.
Values supported by letter-spacing include font-relative values (em, rem), parent-relative values (percentage), absolute values (px) and the normal property, which resets to the font’s default.. The first letter of an element is not always trivial to identify:Only a small subset of CSS properties can be used with the Get the latest and greatest from MDN delivered straight to your inbox.The newsletter is offered in English only at the moment.
Note: The following properties can be used with ::first-letter: font properties; color properties; background properties; margin properties; padding properties; border properties; text-decoration
Definition and Usage.