Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    Regular Coder Kevin_M_Schafer's Avatar
    Join Date
    Apr 2011
    Location
    Fairfax, Minnesota, U.S.A.
    Posts
    482
    Thanks
    97
    Thanked 17 Times in 17 Posts

    Search box length problem

    I have this seach box problem. Without a table, the search box is just the right length in IE9. But in Firefox it's way too long and also in Chrome.

    I placed the search box in a table and that didn't help. The seach box is still different lengths inside the table. I then placed the search box inside a DIV. that didn't help either.

    How can a person keep a search box the same length in all browsers?

    Here is my code:

    <table>
    <table border="0" bordercolor="0" width="200" bgcolor="f0f0f0"><tr><td>

    <div><style>
    .searchBox{
    background-image:url('index_files/tmg.gif');
    background-repeat:no-repeat;
    padding-left:20px;
    }
    </style>
    <form style="margin:0;" method="get" action="http://www.mysearchengine.com/cgi-bin/ts.pl">
    <input type="hidden" name="index" value="000000" />
    <input type="text" name="query" class="searchBox" name="query" value="Search" size="22" onfocus="if (this.defaultValue==this.value) this.value='';"></form></div></tr></td></table>

  • #2
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,332
    Thanks
    5
    Thanked 363 Times in 360 Posts
    If thats your code WITH the table, its not correct.

    Code:
    <form>
    <table>
      <tr>
         <td><input type="text" size="35" /></td>
      </tr>
    
    </table>
    </form>
    Teed

  • Users who have thanked teedoff for this post:

    Kevin_M_Schafer (04-11-2011)

  • #3
    Regular Coder Kevin_M_Schafer's Avatar
    Join Date
    Apr 2011
    Location
    Fairfax, Minnesota, U.S.A.
    Posts
    482
    Thanks
    97
    Thanked 17 Times in 17 Posts
    Okay, I'll redo it right now. Thanks, Teed. I appreciate your help. And I need it!

    I'll post back asap.

  • #4
    Regular Coder Kevin_M_Schafer's Avatar
    Join Date
    Apr 2011
    Location
    Fairfax, Minnesota, U.S.A.
    Posts
    482
    Thanks
    97
    Thanked 17 Times in 17 Posts
    Anyone have any suggestions? I redid my code as Teed said, but all three browsers see the search box in different lengths.

    IE, Firefox, and Chrome all three display the search box differently, with Chrome about 40 pixels longer than IE.

    I thought a table would keep it from expanding, but it didn't

  • #5
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,332
    Thanks
    5
    Thanked 363 Times in 360 Posts
    Do you have a link to your live site so we can view it in different browsers?
    Teed

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • Users who have thanked _Aerospace_Eng_ for this post:

    Kevin_M_Schafer (04-12-2011)

  • #7
    Regular Coder Kevin_M_Schafer's Avatar
    Join Date
    Apr 2011
    Location
    Fairfax, Minnesota, U.S.A.
    Posts
    482
    Thanks
    97
    Thanked 17 Times in 17 Posts

    Here's a link to my site

    Hi Teed,

    It's just an IP until I get it all built and switch the domain. I'm not nearly as good as you guys, but I'm learning and doing everything myself.

    Here is the link: http://96.9.48.31

    The search box is in the upper right-hand corner, under the weather. In Chrome, I notice my outside border doesn't show either.

    Thanks for taking a look guys.

  • #8
    Regular Coder Kevin_M_Schafer's Avatar
    Join Date
    Apr 2011
    Location
    Fairfax, Minnesota, U.S.A.
    Posts
    482
    Thanks
    97
    Thanked 17 Times in 17 Posts

    It's my site, just thought I would say that . . .

    Hey guys, I should tell you, it's my site and I'm doing it for myself. I don't want you think I'm doing it as a job for someone and getting paid.

    I could just use some help. Thanks.

  • #9
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    I didn't say you were. It is in my signature. Did you even try anything of the CSS in the thread I posted?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • Users who have thanked _Aerospace_Eng_ for this post:

    Kevin_M_Schafer (04-12-2011)

  • #10
    Regular Coder Kevin_M_Schafer's Avatar
    Join Date
    Apr 2011
    Location
    Fairfax, Minnesota, U.S.A.
    Posts
    482
    Thanks
    97
    Thanked 17 Times in 17 Posts
    Hi Aerospace Eng,

    Yes, I did. I even used all of your code and placed a sentence under all four of the boxes. It reads, "This is a test to see how far the box stretches." In IE, your boxes reach to the "b" in the word "boxes." In Firefox and Chrome, your boxes reach to the "x" in boxes.

    This is a small problem, but a problem nonetheless. Apparently when a "query" is added to such a box, the problem becomes worse.

    I don't understand how browsers can read the same code and interpret it so differently, especially clean code of simple boxes.

    Thank you for your help. I will try anything you suggest.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •