div CSS text font line Gao Xing distance depth understanding CSS Line spacing settings

Source: Internet
Author: User

div CSS text font line Gao Xing distance DIVCSS5 takes you in-depth understanding of CSS line spacing settings, how font spacing is most easily set. In the article, to achieve the adjustment, set the text font spacing (line spacing) to use the Line-height property. To make the text of each line a certain distance, it can be implemented by Line-height style. Next, DIVCSS5 the font text up and down with a div CSS instance. To observe the effect of the line spacing setting, create a new two Div box object named ". Divcss5-a" and ". Divcss5-b" for the Div. 1. Div+css instance full HTML code:<!DOCTYPE HTML><HTML><Head><MetaCharSet= "Utf-8" /><title>Shijiazhuang Clothing Design</title><style>. Jm880-a{Line-height:22px}/*CSS Comment Description: Set line spacing height 22px*/. Jm880-b{Line-height:40px}/*Set line spacing height 22px*/</style></Head><Body><Divclass= "Jm880-a">I was set to row height 22px<BR/>I have 22 line spacing for training<BR/>jm880 Placeholder Content</Div><Divclass= "Jm880-b">I was set to row height 40px<BR/>I have 40 line spacing for training<BR/>jm880 Placeholder Content</Div></Body></HTML>set up two boxes respectively CSS line height interval set to 22px and 40px, you can copy the above code to observe the effect of the CSS set objects within the font text on the downward spacing. Learn what line height code is set for line spacing. 2, summary to achieve the line line between lines of text line height style In fact, we only use the text in the object set Line-height style can be, the general spacing value is set to more than 14px, according to the CSS font size, CSS row height value can not be less than the font value, Otherwise, the spacing setting value is smaller than the font size value, and the font overlaps a portion, creating an incompatible effect. 

div CSS text font line Gao Xing distance depth understanding CSS Line spacing settings

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.