📜  css space inter words - CSS (1)

📅  最后修改于: 2023-12-03 15:14:18.965000             🧑  作者: Mango

CSS Space Inter-Words

CSS Space Inter-Words is a property used to control the length of whitespace between each word in element content. It can be used to adjust the space between words to make a paragraph or text more readable and visually appealing.

Syntax
selector {
  word-spacing: normal|length|initial|inherit;
}
  • selector: specifies the element(s) to apply the property to
  • word-spacing: specifies the space between words
    • normal: default value. Spaces between words are determined by the browser
    • length: specifies the width of the space in px, pt, cm, etc.
    • initial: sets the property to its default value
    • inherit: inherits the property from its parent element
Example
p {
  word-spacing: 2px;
}

This example sets the space between words in paragraphs to 2 pixels.

Browser Support

The CSS Space Inter-Words property is supported by all major browsers, including Chrome, Firefox, Safari, and Internet Explorer. However, support may vary depending on the version of the browser.

Conclusion

CSS Space Inter-Words is a powerful property that can be used to control how words are spaced in element content. It is easy to implement and can greatly improve the readability and visual appeal of text.