Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8446259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:52:57+00:00 2026-06-10T09:52:57+00:00

I’m using float: left; and float: right; to put two div-containers in one row,

  • 0

I’m using float: left; and float: right; to put two div-containers in one row, the left one holds an input bar, the right one holds a small background image (search button).

It’s showing fine in Opera & Firefox, MSIE 9.0+ but when I view it in chrome the right container’s background image is slightly off position (shifted downwards by a few pixels).

I set the background color to red to highlight the issue:
screenshot

index.php outtake:

<div class="header_inner_right">
    <form id="search_bar" method="post" action="" onsubmit="return checkSearchQuery();">
            <div class="left">
                <input id="search_field" name="q" type="text" value="Search riddim, artist, tune, label and producer" 
                    onfocus="searchFieldValue_onFocus();" onblur="searchFieldValue_onBlur();">
            </div>
            <div class="right">
                <input id="search_button" src="images/search_button.gif" type="submit" value="">
            </div>
    </form>
</div>

index_chrome.css (used if php script detects chrome browser):

@charset "ISO-8859-1";

#search_bar {
    width: 450px;
    height: 37px;
    background-color: red
}

#search_bar #search_field {
    border: 0px;
    width: 365px;
    height: 37px;
    padding-left: 20px;
    padding-right: 20px;
    background-image: url(../images/search_field.gif);
    background-repeat: no-repeat;
    font-weight: bold;
    color: #c0c0c0;
    background-color: #ffffff
}

#search_bar #search_button {
    cursor: pointer;
    border: 0px;
    outline: none;
    height: 37px;
    width: 45px;
    background-image: url(../images/search_button.gif);
    background-repeat: no-repeat
}

How to fix it and adjust the y-position of the magnifying-glass background image so its perfectly aligned with the left div’s background image and fully concealing the red background of the right div container?

EDIT: http://jsfiddle.net/YcraM/

Sorry, forgot about JSFiddle!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T09:52:59+00:00Added an answer on June 10, 2026 at 9:52 am

    This might not be the answer you want to hear, but it’s pretty much impossible to make most input elements look identical cross browsers. I urge you to fashion the submit button from a div element. Example:

    <div class="left">
        <input id="search_field" name="q" type="text" value="Search riddim, artist, tune, label and producer" 
            onfocus="searchFieldValue_onFocus();" onblur="searchFieldValue_onBlur();">
    </div>
    <div class="right">
        <div id="search_button"></div>
    </div>
    

    Style the div with css to your liking – remember to use the :hover and :active pseudo classes. Then, using for example jQuery, make it functional like this:

    $('#search_button').on('click', function(e) {
        $(e.currentTarget).closest('form').submit();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am reading a book about Javascript and jQuery and using one of the
I'm making a simple page using Google Maps API 3. My first. One marker
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.