How can I adjust the search bar position without affecting the mobile version?

Topic summary

A user is trying to vertically center their search bar to align with the logo, ensuring equal spacing above and below. The challenge is making this adjustment only for desktop while keeping the mobile version unaffected.

Attempted Solutions:

  • Initial suggestion involved adding CSS code to the theme.liquid file (above the </body> tag)
  • Alternative approach recommended adding padding CSS to the Assets > Base.css file

Issue:
The proposed CSS changes are affecting both desktop and mobile views, which is not the desired outcome.

Current Status:
The discussion remains ongoing. A revised code snippet has been offered to replace the previous solution, but it’s unclear if this addresses the mobile responsiveness concern. The user needs a CSS solution that targets only the desktop layout without impacting mobile styling.

Summarized with AI on November 17. AI used: claude-sonnet-4-5-20250929.

Hello There ,

How to bring the search-bar a bit down so it is the same as logo . The height above the search bar should be same as the height below . What ever change i make affects the mobile version too , mobile version should not be affected . how should i do it?

site url :: https://1ajhtj8ajh4a5fcv-71493648693.shopifypreview.com

Hey @Anonymous

Follow these Steps:

  1. Go to Online Store

  2. Edit Code

  3. Find theme.liquid file

  4. Add the following code in the bottom of the file above tag


RESULT:

If I managed to help you then, don’t forget to Like it and Mark it as Solution!

Best Regards,
Moeed

@Anonymous Go to Assets > Base.css and put below css at bottom of file.

.field
{ padding-top: 10px !important;}

This code is changing it in mobile view of the website and it is not proper, how to fix it

Hey @Anonymous

Remove the previous code and add this code with the same steps.


If I managed to help you then, don’t forget to Like it and Mark it as Solution!

Best Regards,
Moeed

1 Like