Title: Center text vertically without using padding
Last modified: January 12, 2021

---

# Center text vertically without using padding

 *  Resolved [andrew_long15](https://wordpress.org/support/users/andrew_long15/)
 * (@andrew_long15)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/center-text-vertically-without-using-padding/)
 * Depending on length of text, sometimes my button has one line of text, sometimes
   two lines.
 * Using the padding feature to vertically centre the text does not work in this
   case because without using padding the “one line of text” will be at the top 
   of the button, whereas the “two lines of text” will be centred. If I use padding,
   then I can centre the “one line of text”, but then the “two lines of text gets
   pushed down”.
 * So I am forced to use two different buttons simply because some have more text
   than others.
 * See this page: [https://greatnessu.com/acm-specialist-register/](https://greatnessu.com/acm-specialist-register/)
   Where I had to copy a button so there would be one with padding=3 and one with
   padding=13. This is a clunky solution.
 * Is it possible to centre-align text VERTICALLY in the button without using padding?

Viewing 1 replies (of 1 total)

 *  Plugin Author [Bas Schuiling](https://wordpress.org/support/users/basszje/)
 * (@basszje)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/center-text-vertically-without-using-padding/#post-13900454)
 * Sadly, pure vertical centering is a quite complicated thing on webpages. At the
   moment we have not something simple like how the text centering does it.
 * I think you can do the following:
 * – Put both width and height to 0 .
 * – Add padding for everything (left, right, top, bottom) . Best result is usually
   to give same padding for left, right but give the top a little more padding than
   the bottom.
 * – If you always use those buttons in a column, you can also put the width to 
   a percentage, i.e. 100% to make all buttons fill out the same column width.

Viewing 1 replies (of 1 total)

The topic ‘Center text vertically without using padding’ is closed to new replies.

 * ![](https://ps.w.org/maxbuttons/assets/icon-128x128.png?rev=1378636)
 * [MaxButtons - Create buttons](https://wordpress.org/plugins/maxbuttons/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/maxbuttons/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/maxbuttons/)
 * [Active Topics](https://wordpress.org/support/plugin/maxbuttons/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/maxbuttons/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/maxbuttons/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Bas Schuiling](https://wordpress.org/support/users/basszje/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/center-text-vertically-without-using-padding/#post-13900454)
 * Status: resolved