Home > front end >  In the CSS styles
In the CSS styles

Time:12-12

In CSS style, why is it that, for a single line text, text using padding can make vertical center?

CodePudding user response:

Padding is to add padding to elements, or you put on the bottom to account for, put the words into the middle

CodePudding user response:

Because the fill the content of the the its height more than the original height , such words above and below is the distance to the system

CodePudding user response:

reference 1/f, even burn load response:
padding is add padding to the element, the equivalent of you put on the bottom to account for, put the word into the middle

thank you, see.

CodePudding user response:

refer to the second floor chinaskysun response:
because fill the content of the the the height of itself more than the original , such words above and below is the distance to the system as the

Well,, the upstairs brothers say good understanding of the point

CodePudding user response:

reference light powder of dung beetles reply: 3/f
Quote: refer to 1st floor even burn load response:
padding is add padding to the element, the equivalent of you put on the bottom to account for, put the word into the middle

thank you, see.

Set padding padding, element itself wide high will change, so you pay attention to when setting, width must be high if the element itself, how much you set the padding, from their own minus how much, this element of wide high will only be the same, of course, if the width is absolutely no need to worry about it

CodePudding user response:

Remember junction post
Baidu box model, there are many kinds of box model, learn a two is enough,
  • Related