Home>Article>Daily Programming> How to use css text-align-last attribute

How to use css text-align-last attribute

silencement
silencement Original
2019-05-26 13:27:46 6905browse

How to use css text-align-last attribute

text-align-last attribute definition and usage

In css, text-align-last attribute It is used to specify how to align the last line of text. To use this attribute, the text-align attribute must be set to "justify", otherwise the text-align-last attribute will not work.

Only Internet Explorer supports the text-align-last attribute, but the start and end attribute values are not supported. Firefox browser supports -moz-text-align-last attribute to replace this attribute.

text-align-last attribute syntax format

css syntax: text-align-last: auto/left/right/center/justify/start/end/initial /inherit

JavaScript syntax: object.style.textAlignLast="right"

Attribute value description

auto: Default value, the last line is adjusted , aligned to the left

left: the last line is aligned to the left; right: the last line is aligned to the right

center: the last line is aligned in the center

justify: the last line is adjusted Align both ends

start: The last line is aligned at the beginning of the line (if the text-direction is from left to right, then align to the left; if the text-direction is from right to left, then align to the right)

end: The last line is aligned at the end of the line (if the text-direction is from left to right, align to the right; if the text-direction is from right to left, align to the left)

initial: Set this attribute to its default value

inherit: Inherit the text-align-last attribute value from the parent element

Example

How to use css text-align-last attribute

The above is the detailed content of How to use css text-align-last attribute. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn