Center Align Predictive Search under custom search bar?

Center Align Predictive Search under custom search bar?

Brian-A
Pathfinder
111 0 27

Center Align Predictive Search under custom search bar?

 

Isolated the code but when adding it to Base.css not taking effect, not sure if I'm using right min/max.

Also having trouble setting the code for desktop then mobile is changing differently. 

 

www.extremekool.com

Password01

 

IMAGE1: Desktop view - Search is off a bit, I used left 50 but not sure if I can use align center?

222Capture.PNG

 

 

Image2: Mobile - off by a bit 

111Capture.PNG

Replies 3 (3)

Dan-From-Ryviu
Shopify Partner
12019 2349 2529

Hi @Brian-A 

You can do that by adding this code to Custom CSS in Online Store > Themes > Customize > Theme settings 

html predictive-search[open] .predictive-search, 
html predictive-search[loading] .predictive-search {
    margin-left: -50px;
}

Screenshot 2025-01-07 at 09.11.37.png

- Helpful? Like & Accept solution! - Support me? Buy me a coffee
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

DaisyVo
Shopify Partner
4469 501 598

Hi @Brian-A ,

You can follow the steps here:

 

Step 1: Shopify admin > Online store > Customize: https://prnt.sc/XQ6IDB99kUCd
Step 2: From the left menu > Theme settings > Open Custom CSS: https://prnt.sc/ypQ7nly2wv27
Step 3: Copy the code below and paste it there

 

Here is the code for step 3:

@media screen and (min-width: 1200px){
body predictive-search[open] .predictive-search {
    left: 0 !important;
    transform: unset !important;
    margin-left: 0 !important;
}
}

Here is the result:

DaisyVo_0-1736216046653.png

 

Please let me know if it works!

Best,

Daisy

Please let us know if our reply is helpful by giving it a Like or marking it as a Solution!

Avada SEO & Image Optimizer - The #1 SEO solution

CoffeeAndCode
Shopify Partner
21 2 1

Try this CSS in one of your style tags somewhere in your template:

div.predictive-search.predictive-search--header {
    margin-left: 0 !important;
}

 

Spark Tools for Inbox - Power-up your Inbox chat: Customize icon, css, font, text, proactive messages, and more!