S
S
SevSergei2017-11-16 11:45:05
css
SevSergei, 2017-11-16 11:45:05

Is it better to use padding or height property for buttons?

Is it better to use the padding or height property for optimal button layout?
It will be easier if you ask for example:

height: 60px;
vertical-align:middle;

Or is it better to calculate indents? How do you make buttons?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
Z
zoozag, 2017-11-16
@zoozag

padding works when the height of the button is not fixed, for example the text in the button can wrap over multiple lines and when the button is made via a link rather than an input or button

A
Ankhena, 2017-11-16
@Ankhena

In fact, it depends on the layout and on who and how will insert and edit the content.
It is more expedient to use paddings, less likely to get text that comes out.
But designers and their requirements are different.

S
Sergey Melodin, 2017-11-16
@melodyn

If you have the same font size and the same padding in all buttons, then the height will be the same. It makes no sense to set a fixed height, because then you either need to hide the text of the second line (it can slide when scaling, for example), or it will crawl out of the button.

E
Egor Zhivagin, 2017-11-16
@Krasnodar_etc

More universal - indents. And you don't have to worry about text alignment.

G
Gortyser, 2017-11-16
@Gortyser

Better than padding, limiting the height is generally a pretty bad idea in most cases.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question