This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Customize Search Results Width

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Customize Search Results Width

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #19012
    hartliephartliep
    Participant

    I have a search bar on this website, and the search text box itself is sized exactly how I want it, but the search results are not. I searched for a way to customize the width of the results box, but was only able to find height (for vertical results). I was able to find the css that controls this via the inspect tool in Chrome, but when I took all of the css data (ID and classes) and tried to change it in the css editor, nothing happened, even after clearing the cache(s).

    Am I missing something? I need the search results drop-down to be 500px wide on desktop (it looks fine on mobile), and I need the right side of the search results box to align with the right side of the search text box.

    • This topic was modified 7 years, 9 months ago by hartliephartliep.
    #19015
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi!

    The width of the floating results is set to follow the width an float of the search bar at all times.

    To change it’s width separately, I recommend using this custom CSS:

    [html].asp_r {
    width: 400px !important;
    margin-left: -154px !important;
    }[/html]

    This will change it’s width to 400 pixels, and also aligns the results to the right of the search bar with a negative margin. You can change these values of course, as you like.

    You can apply this code on your theme custom CSS field (if it supports it) or use the custom CSS field on the search plugin back-end.

    #19026
    hartliephartliep
    Participant

    That worked! Thank you! I ended up needing to wrap that in a media query, but other than that, no drama!

    #19032
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    #19041
    hartliephartliep
    Participant

    That is fine, and I will definitely do that. Thank you!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Customize Search Results Width’ is closed to new replies.