WordPress.org

Forums

[resolved] Edit position of search button / field (3 posts)

  1. zaqedc
    Member
    Posted 3 years ago #

    I've got a header that is basically just a row of images. On the right hand side I want to put the default wordpress search box. I called get_search_form() and this put it in the header but underneath the row of images. Put the following in the style.css to solve that:

    .searchfield{
    	float: right;
    	margin-top:-38px;
    	margin-left:15px;
    	}

    However, although this puts the text field in the same line/row as the images the search button remains in the exact same place, underneath that row of images.

    I couldn't find anything in the css file that shows attributes for a search button. Checking the searchform.php I noted the id "searchsubmit" assigned to the button, so I put the following into the css file, underneath the .searchfield part, hoping it would work:

    .searchsubmit{
    	float: right;
    	margin-top:-38px;
    	margin-left:15px;
    	}

    The header remains the exact same: The row of images displays, the search text field next to them and, below that row, the lone search button.

    If anyone has an idea of how to solve this I'd be really grateful, because I'm stumped!

  2. zaqedc
    Member
    Posted 3 years ago #

    Found a section called input#s, which looks like it may control the button's positioning. I've tried the following attributes in varying combinations:

    float: right;
    margin-top:-38px;
    margin-right:30px;

    No success.

  3. zaqedc
    Member
    Posted 3 years ago #

    Resolved. I mistakenly used a dot (.) instead of the hash symbol (#) in front of the searchsubmit section I had added to the css file. Looks like this and works correctly now:

    #searchsubmit{
    	float: right;
    	margin-top:-38px;
    	margin-left:15px;
    	}

Topic Closed

This topic has been closed to new replies.

About this Topic