How to apply the line-height function of css
This article mainly explains how to apply the line-height function of css. Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn "how to apply the line-height function of css"!
There is only one line of ink in the page, that is, a single line of ink. To be vertically centered, you need line-height to complete the vertical centering.
vertically centered text reveal
Looking at the picture above, the string "I am vertically centered in white" is vertically centered in white. Css line can be taken high color line-height to complete.
Centering method:
Line-height setting value and, snow white peripheral height maintain the difference can be completed vertical centering.
To draw inferences from one instance:
To center a line of calligraphy vertically in the object box, you need to match the line-height value with the height value.
line-height centered small example broken code:
line-height to complete vertical centering CSS5.jzsl{border:20px solid #CCC;background:#FFF;height:80px;line-height:80 px} This DIV height setting equipment 80px, line height setting equipment 80 px, complete calligraphy vertical centering
The above code can be copied directly to the actual test learning.
Small example screenshot:
At this point, I believe that everyone has a deeper understanding of "how to apply the line-height function of css," so you may wish to actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!