WordPress.org

Ready to get started?Download WordPress

Forums

Help with centering a button (2 posts)

  1. clinjar89
    Member
    Posted 1 year ago #

    Hello,

    I am very new to coding and I am struggling with getting a button centered on my homepage. Here is the code for the button, any suggestions as to how I can center it? I have tried: <div style="text-align:center">

    <?php echo thanks_button('Thanks', true); ?>
    </div>

    Thanks!

  2. zex2911
    Member
    Posted 1 year ago #

    Hello
    Try not to use in-line styles when ever you can... Try something like this

    <div class="center-align">
    
    <?php echo thanks_button('Thanks', true); ?>
    </div>

    and in your style.css add this

    .center-align{display:block;margin:0 auto}

    If that doesn't help, link to your page with the problem will.

Topic Closed

This topic has been closed to new replies.

About this Topic