The difference between letter-spacing and word-spacing

Source: Internet
Author: User

The difference between letter-spacing and word-spacing:
The two attributes in the title of the use of the frequency, although not much, but can not be said to be useless, both of them because of the appearance and the role of similarities, but there are very different, the following examples of simple introduction.
Example one:

<!DOCTYPE HTML><HTML><Head><MetaCharSet= "Utf-8"><Metaname= "Author"content= "http://www.51texiao.cn/" /><title>Ant Tribe</title><styletype= "Text/css">. First{letter-spacing:40px;}. Second{word-spacing:40px;}</style></Head><Body> <Divclass= "First">I am a good boy</Div> <Divclass= "Second">I am a good boy</Div></Body></HTML>

As can be seen from the above code performance, letter-spacing modifies the spacing between letters or characters, while word-spacing modifies the spacing between words. In the above code, letter-spacing the spacing between letters to 40px, it should be noted that the space is also a character, such as "I" and "AM" between the space and the letters on both sides of the spacing is also set to 40px, so "I" and "a" between the spacing is 80px. Word-spacing will set the spacing between words to 40px.

Special Note:

Letter-spacing and word-spacing are accurate not to set the spacing between letters and words, but to add the specified spacing after the specified letters and words, except for the last letter and word.

Example two:

<!DOCTYPE HTML><HTML><Head><MetaCharSet= "Utf-8"><Metaname= "Author"content= "http://www.51texiao.cn/" /><title>Ant Tribe</title><styletype= "Text/css">. First{letter-spacing:40px;}. Second{word-spacing:40px;}. Third{word-spacing:40px;        }</style></Head><Body> <Divclass= "First">Ant Tribe</Div> <Divclass= "Second">Ant Tribe</Div> <Divclass= "Third">Ant Tribe</Div></Body></HTML>

The performance of the above code can be seen, for Chinese characters, if linked together is considered as a "word."

The original address is: http://www.51texiao.cn/div_cssjiaocheng/2015/0501/517.html

The most original address is: http://www.softwhy.com/

The difference between letter-spacing and word-spacing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.