Site logo

[Resolved] How to add line/spacing between buttons

Home Forums Support [Resolved] How to add line/spacing between buttons

Home Forums Support How to add line/spacing between buttons

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2055166
    mamin

    Hi,

    I added some link buttons into the Single Product Page using WC Hooks. I’d like to have some line spacing 1. between the two buttons, and 2. between the last button and the line prior to the product meta section. Tried adding <br> into the if statement below but doesn’t seem to work.

    Note: Buttons displayed may be 0/1/2 depending on url availability.

    Code used in Elements:

    <?php
        $url_platform1 = get_post_meta( get_the_ID(), 'url_platform1', true );
        $url_platform2 = get_post_meta( get_the_ID(), 'url_platform2', true );
        if ( $url_platform1 ) :
        ?>
            <a class="button" style="background-color:#FF6600" href="<?php echo $url_platform1; ?>" target="_blank">Buy It On Platform1</a>
    			<?php
        endif;
    
        if ( $url_platform2 ) :
        ?>
            <a class="button" style="background-color:#0f1268" href="<?php echo $url_platform2; ?>" target="_blank">Buy It On Platform2</a>
    			<?php
        endif;
    ?>

    Link and code included for reference.

    Thanks in advance.

    #2055216
    Elvin
    Staff
    Customer Support

    Hi there,

    You can try adding margin-bottom: 20px; style to the first button so there’s spacing between the 2 buttons. 😀

    #2055401
    mamin

    Works great. Thanks.

    #2056232
    Elvin
    Staff
    Customer Support

    No problem. 😀

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.