How to move the search box to right

Featured Theme Forums CSS and PHP How to move the search box to right

This topic contains 4 replies, has 2 voices, and was last updated by  massy74 1 year, 4 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #13454

    massy74
    Participant

    Hi

    My website is http://www.ultimech.com/wordpress

    The theme I am using now, for some reason, does not show search box but I know that it would appear in the middle of blog area(latest updates do that but I like the old one). I have added the code below and it now appears right next to the top menu where I want it to be:
    add_filter(‘wp_nav_menu_items’,’add_search_box’, 10, 2);
    function add_search_box($items, $args) {
    ob_start();
    get_search_form();
    $searchform = ob_get_contents();
    ob_end_clean();
    if( $args->theme_location == ‘Header’ )
    $items .= ” . $searchform . ”;
    return $items;
    }

    I would like to push it to the end right as it appears just next to the last link. I tried with CSS but nothing works. Would you be so kind as to help me out?

    Also I have noticed that the size of the search box changes if I use IE as it becomes bigger. Does anyone know the reason?

    Thank you so much in advance and look forward to hearing from you.
    Max

    #15329

    Zeaks
    Participant

    Using this seems to work in Firebug. Lots of things look different in IE, same with firefox vs chrome and other browsers, you would probably need to use IE specific CSS to style it for earlier versions of IE.
    .top-search {
    float: right;
    margin-right: -400px;
    }
    Adding the searchbox to the header instead of a menu item would probably allow for better adjustment, as a menu item it will take the first available spot.

    #15330

    massy74
    Participant

    Thank you.

    It did work indeed and it appears perfect if I use chrome. I tried to visualise my website with IE and the search has moved but it is so long that it goes out of the menu. Any help?

    #15331

    Zeaks
    Participant

    Try specifying a width like
    .top-search { width: 250px; }

    #15332

    massy74
    Participant

    Hi

    It worked indeed but it is positioned at the far end when I use IE. I would like the search box to be located in the same position when I use chrome. would that be possible? how can I get the same UE across all different browsers?

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.