Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Cart Button Coding WordPress

  • SOLVED

How can I make the Proceed to Cart, Amazon Pay, and PayPal Pay buttons line up across horizontally with padding in between on desktop, but then vertical align with padding on mobile?

Thanks

https://steelfitusa.com/cart/

Answers (2)

2018-09-18

Arnav Joy answers:

you this for desktop

#wc_braintree_paypal_container {

float: right;
padding: 0 20px;

}

it will look like this

http://i.share.pho.to/afeee4b9_o.png


Arnav Joy comments:

you this for mobile
#pay_with_amazon {
padding: 15px 0 8px 0;
}

@media(max-width:620px){
#wc_braintree_paypal_container {
float: right;
padding: 0px 0;
}
}


robkaufman comments:

Thank you. Any way to add the padding on the mobile?


Arnav Joy comments:

@media(max-width:620px){
#pay_with_amazon {
padding: 15px 0 8px 0;
}

#wc_braintree_paypal_container {
float: right;
padding: 0px 0;
}
}


robkaufman comments:

Worked like a charm! Thank you


Arnav Joy comments:

Good to know, please close this task and assign me prize.

2018-09-18

Cesar Contreras answers:

You can use the following native WP conditional function to verify if the user is visiting using a mobile device, if so, there you can add the code that you need CSS or JS, you choose what you want to do.

This is the documentation link ( https://codex.wordpress.org/Function_Reference/wp_is_mobile )

And this is the function...
<?php
if ( wp_is_mobile() ) {
/* Display and echo mobile specific stuff here */
}
?>