Move text and button of banner image on different positions for desktop and mobile

Hello everyone!

So, I found a code online and I managed to have 2 different banner pictures for both desktop and mobile.

Now I want to move the banner content (text & button) to a different position for the desktop version (all the way to the left) and on another position for the mobile version (all the way to the top). Could you please help me with that?

I can provide store URL and password through PM upon request.

Thanks!

Madeleine

Hi @sirensiren

Would you mind to share your Store URL website? with password if its protected. Thanks!

Yes, I sent you a PM. Thank you :slightly_smiling_face:

Thank you for the info.

For the desktop version (all the way to the left), is this enough or more?

If this enought try this code.

  • From your Shopify admin dashboard, click on “Online Store” and then “Themes”.
  • Find the theme that you want to edit and click on “Actions” and then “Edit code”.
  • In the “Assets” folder, click on “base.css, style.css or theme.css” file, depending on which file your theme uses to store its CSS styles. At the bottom of the file, add the following CSS code:
.banner__content.banner__content--middle-left.page-width, .banner__box.content-container.content-container--full-width-mobile.color-background-1.gradient {
    padding-left: 0px;
}
  • And Save.

For the mobile version (all the way to the top).

  • Same Instruction.
@media only screen and (max-width:749px){
.banner__box.content-container.content-container--full-width-mobile.color-background-1.gradient {
    padding-top: 10px;
    position:absolute;
    top: 0px;
}
}

My dear friend, it worked for mobile but not for desktop. Any ideas why?

Please refresh it, on my side it move to the left. But I think you want far left?

Hmm, maybe it did move but I didn’t notice it! Can we move it more to the left, please?

You know what, it’s ok! I think this position is enough and it doesn’t need further modification. Thank you so much for taking the time to help me! I appreciate it very much! :slightly_smiling_face: :heart:

Like this?

if it is then try this code, same instruction.

.banner__content.banner__content--middle-left.page-width {
    max-width: 100%;
    padding-left: 5rem;
}

And Save. if you like to adjust from the left just reduce the padidng.

Made4uoRibe_2-1696946775298.png

Welcome. :blush: