I am using WordPress buttons I would like to know how to align Button on the right of the image on desktop but below the image on mobile.

Here is an example: https://www.verywellfit.com/best-ankle-weights-4158657

Please see the amazon buttons on this page.

On desktop this buttons align to the right. like this: enter image description here

and on mobile the buttons are below the image: enter image description here



CSS would check the width of the screen, and (if small enough), change the display of the picture to block. As taught by W3Schools ...

.the-price {
    display: inline-block;
@media only screen and (max-width:600px) {
    .the-image {
        display: block;
<img class="the-image" src="...">
<div class="the-price">...</div>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.