- Services
- Case Studies
- Technologies
- NextJs development
- Flutter development
- NodeJs development
- ReactJs development
- About
- Contact
- Tools
- Blogs
- FAQ
CSS Text-Justify Enhance Text Alignment
Learn about available options like auto, inter-word, and inter-character.
Introduction
The text-justify
CSS property controls how text is justified when text-align: justify;
is applied. Justification spreads text evenly across the available space, making it more visually appealing. This property is useful for web design to enhance readability and aesthetics.
Specification
The text-justify
property is defined in the CSS Text Module Level 3. You can find the official documentation in the CSS Text Module Level 3 under the section for the text-justify
property.
Syntax
Here’s how to use the text-justify
property in CSS:
Values
none
: Turns off text justification.auto
: The browser chooses the best justification method.inter-word
: Justifies text by adjusting spaces between words.inter-character
: Justifies text by adjusting spaces between characters.distribute
: Deprecated, behaves likeinter-character
.
Global values include:
inherit
: Inherits thetext-justify
value from the parent element.initial
: Sets the property to its default value.revert
: Reverts to the user agent’s default stylesheet value.revert-layer
: Reverts to the value for the current cascade layer.unset
: Resets the property to its initial or inherited value.
Formal Definition
- Initial Value:
auto
- Applies To: Inline-level and table-cell elements
- Inherited: Yes
- Computed Value: As specified
- Animation Type: Discrete
Examples
Simple Example
Here’s a simple example to demonstrate the different values of text-justify
:
Example with Interactive Buttons
Browser Compatibility
- Chrome: Full support.
- Firefox: Supported from version 55.0.
- Internet Explorer/Edge: Supported from IE 11.0.
- Opera: Full support.
- Safari: Supported from version 10.0.3.
See Also
For more information, check out:
- [
text-align
]WebsiteUrl - [
text-indent
]WebsiteUrl - [
text-overflow
]WebsiteUrl - [HTML Reference Guide]WebsiteUrl
These resources will help you understand text formatting and alignment in web development, making your web pages more polished and professional.
Talk with CEO
We'll be right here with you every step of the way.
We'll be here, prepared to commence this promising collaboration.
Whether you're curious about features, warranties, or shopping policies, we provide comprehensive answers to assist you.