div CSS text font line Gao Xing distance depth understanding CSS Line spacing settings
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. (Body feeling music)
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.
Related Extended CSS Tutorials:
CSS Line-height
div CSS Word spacing
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: (Body music)
- <! DOCTYPE HTML>
- <html>
- <head>
- <Meta charset="utf-8" />
- <title>divcss5 css Line spacing instance </title>
- <style>
- . divcss5-a{line-height:22px}/* CSS Comment Description: Set line spacing height 22px */
- . divcss5-b{line-height:40px}/* Set line spacing height 22px */
- </style>
- </head> (somatosensory music)
- <body>
- <div class="divcss5-a">
- I was set to line height 22px<br />
- My line spacing is 22 training <br />
- DIVCSS5 placeholder Content
- </div>
- <div class="Divcss5-b">
- I was set to line height 40px<br />
- My line spacing is 40 training <br />
- DIVCSS5 placeholder Content
- </div>
- </body>
- </HTML> (Body Sense music)
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, CSS Div line High Line spacing effect
Font up and down line spacing Css+div instances
3. Summary
To implement line spacing between line lines line height style In fact, we only use the text on the object to set the Line-height style, 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.