Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the differences between line-height and height in CSS

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report