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 3 of 3
  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

    converting search query box to css box -- if possible

    Is it possible to use a css border box for a search query box? The current one I have is established with size="31." This method is unpredictable, as the length of "31" is different in different browsers.

    If I could establish a box in css in which to type a query, it may not change like the size "31" box -- in theory.

    Here's my CSS to add the magnifying glass image:
    .searchBox{
    background-image:url('. . . /index_files/tmg.gif');
    background-repeat:no-repeat;
    padding-left:20px;
    }

    Here's my HTML:
    <form style="MARGIN: 0px" method="get" action="http://www.picosearch.com/cgi-bin/ts.pl">
    <input name="index" value=" . . . 0 . . . " type="hidden"/> <input class="searchBox" onfocus="if (this.defaultValue==this.value) this.value='';" name="query" value="Search" size="31"/></form>

    Is it possible to use a css border box for a query box?

    Any insight would be appreciated. Thanks.

  • #2
    Senior Coder
    Join Date
    Apr 2011
    Location
    London, England
    Posts
    2,120
    Thanks
    15
    Thanked 354 Times in 353 Posts
    Just add these to the css for .searchBox
    Code:
    width: 200px; /* or whatever you like */
    /* add a height if you need */
    border: 1px solid blue;    /* there are many other border properties you can use */
    but don't forget to remove size="31".
    "I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
    Validate your HTML and CSS

  • Users who have thanked AndrewGSW for this post:

    Kevin_M_Schafer (04-30-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
    Andy,

    Good grief, how do you know how to do all of this? It worked, just like you said!

    Thank you a ton!


  •  

    Posting Permissions

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