Word Count: 112
  • Post category:Codings
  • Post last modified:2021-06-22

Introduction

This article describes the method to create a button in Elementor to meet the required button width and height.

Steps

  • Add the Button element to the page.
  • In Typography section, set the text’s line-height to
    • line height = (required height) – 2 x (border width)
  • In Border section, set the border width for both “Normal” and “Hover” states.
  • Temporarily set Padding to 0 for Top, Right, Bottom and Left.
  • Refresh the web page and use Dev Tool to read the length of the text inside the button. Let this length be L.
  • Now set the padding left and right according to this formula:
    • padding left = padding right = [ (required width – L) / 2 ] – (border width)