What are the differences between line-height and height in CSS
This article is about the differences between line-height and height in CSS. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
The line-height-- line height property, which sets the separation between the upper and lower margins of the text mode.
Height-- height property, sets the height of the equipment installation object
Line-height and height discrimination:
1. Disobey differences
Line-height sets the space between high and low text, and height configures the height of the object box.
2. Different words
One height is high and one line-height line is high (text bump spacing).
How to make up your mind and how to use it?
Set the height of the equipment installation object and apply height
Set the height of the distance between articles, paragraphs and single lines (line height), and use line-height.
Line height and high div css instance code:
Height and line-height use examples CSS5.box {height:100px; width:200px; border:1px solid # F00} .lh30 {line-height:20px} .lh40 {line-height:30px} to set the height 100px, line height 20px to see the upper and lower distance of the text, slander the equipment height 100px, line height 30px to look at the text paragraph high and low distance isolation distance results thank you for reading! This is the end of the article on "what are the differences between line-height and height in CSS". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!