+ Reply to Thread
Results 1 to 9 of 9

Thread: Quick search bar help...

  1. #1
    vrufusx65v's Avatar
    vrufusx65v is offline x10Hosting Member vrufusx65v is an unknown quantity at this point
    Join Date
    Aug 2009
    Location
    Dublin, Ireland
    Posts
    74

    Question Quick search bar help...

    I have a custom search bar with a uncooperative textfield. I linked the code and a picture of the problem. I need to get either the textfield small enough so it looks like its one fluid search bar, or a way to make the text field transparent so that you can only see the background picture behind it. is their such a way or am i just blowing smoke???

    HTML
    Code:
    <div class="navsearch">
    	<form id="search" method="get" action="http://shotsoundstudios.net/">
    	<input class="search" onClick="if(this.value == 'Search SS Studios...')
    	this.value='';" onBlur="if(this.value.length == 0) this.value='Search SS Studios...';"
    	value="Search SS Studios..." name="s">
    	</form>
    	<img src="images/searchbutton.png" id="searchbutton" />
    </div>
    CSS
    Code:
    .navsearch {
    	float:right;
    	width:230px;
    	height:20px;
    	margin-right:176px;
    	margin-top:5px;
    }
    
    .navsearch #search {
    	float:left;
    	background-image:url(../images/searchbar.png);
    	width:156px;
    	height:20px;
    }
    
    input.search {
    	margin-top:2px;
    	height:15px;
    	width:140px;
    	color:#FFF;
    	background-color:#595959;
    	border:none;
    }
    
    .navsearch #searchbutton {
    	float:right;
    	background-image:url(../images/searchbutton.png);
    	width:59px;
    	height:20px;
    	margin-right:10px;
    	margin-top:px;
    }
    Picture of the Problem:
    Quick search bar help...-pic.png

  2. #2
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Quick search bar help...

    Set the background-color of input.search to "transparent" rather than #595959.

    Rather than a text box whose size is determined by the background image, you can make an elastic one by using a tileable background image with end pieces set using :before and :after pseudo-elements (for IE gte or by inserting actual elements (for IE lte 7). Read "Multiple Backgrounds and Borders with CSS 2.1" for specifics.
    Last edited by misson; 12-09-2010 at 12:35 AM.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  3. #3
    vrufusx65v's Avatar
    vrufusx65v is offline x10Hosting Member vrufusx65v is an unknown quantity at this point
    Join Date
    Aug 2009
    Location
    Dublin, Ireland
    Posts
    74

    Re: Quick search bar help...

    sweet, that background-color to transparent worked, as it should of...but now my text is black instead of white, and also my @font-face isn't working right, i have one font that i want the entire webpage to have, but it stays on the default times new roman or arial, whatever i have it set to within dreamweaver. I know my text.css containing the @font-face is correct but how should i have my style.css and index.html setup to understand the font?
    Last edited by vrufusx65v; 12-09-2010 at 05:42 PM.

  4. #4
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Quick search bar help...

    You should know it's hard to answer questions about source without seeing it. Your original sample has a hint about where to find the live page you're testing (somewhere on shotsoundstudios.net), but the main page doesn't lead anywhere. The only style sheet I can see (http://shotsoundstudios.net/css/style.css) doesn't use the @font-face directive. How about a minimal test case and links to live pages?
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  5. #5
    vrufusx65v's Avatar
    vrufusx65v is offline x10Hosting Member vrufusx65v is an unknown quantity at this point
    Join Date
    Aug 2009
    Location
    Dublin, Ireland
    Posts
    74

    Re: Quick search bar help...

    Sorry about that, it was late and i wasnt running on all cylinders...

    my live test page is http://betatest.shotsoundstudios.net/

    im hoping you and all others in the forums know how to read code via firebug or even "view > Page Source"...

  6. #6
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Quick search bar help...

    Quote Originally Posted by vrufusx65v View Post
    im hoping you and all others in the forums know how to read code via firebug or even "view > Page Source"...
    Sure we can, but that still means we have to wade through extraneous code (unless the linked page is a minimal test case), which (among other things) lengthens how much time it will take to fix your problem. If it's going to take too much time, many might not bother. If you want us to check the source (such as if the source is too large to post here), it's best to point out where in the code to look, especially when there are multiple files involved. Posting source in the forum also creates a record of what you did, so that you can change the live page without causing confusion. This will help others with a similar problem to yours who come across the thread.

    (For the @font-face problem, I went for view resources rather than view source, as it let me quickly view the external style sheets).

    Where I see the @font-face is in text.css:
    Code:
    @font-face {
        font-family: myriadpro;
        src: url(css\MyriadWebPro.ttf);
    }
    The value for src has two problems:
    • backslash isn't a path separator, it's an escape character. Since the escape "\M" is equivalent to "M", the slash is dropped, so the URL is equivalent to "url(cssMyriadWebPro.ttf)". Change it to a forward slash.
    • Relative URLs in style sheets are relative to the style sheet. The above URL (after fixing the slash) would translate to "http://betatest.shotsoundstudios.net/css/css/MyriadWebPro.ttf". Change the path to an absolute path (or remove the "css/", though this is potentially confusing).

    The fixed version is:
    Code:
    @font-face {
        font-family: myriadpro;
        src: url(/css/MyriadWebPro.ttf);
    }
    As for the text color of the search box, you haven't set it anywhere. Form input elements have default styling provided by the user agent. You have to override this in your style sheets.
    Last edited by misson; 12-10-2010 at 08:01 AM.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  7. #7
    vrufusx65v's Avatar
    vrufusx65v is offline x10Hosting Member vrufusx65v is an unknown quantity at this point
    Join Date
    Aug 2009
    Location
    Dublin, Ireland
    Posts
    74

    Re: Quick search bar help...

    the fixed version didnt work. Is it because i dont have the font-family connected to the text somehow?

  8. #8
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Quick search bar help...

    If you haven't set the font-family for the input, then the user agent styling will take precedence over inherited values, just as with the text color. You must override any user agent provided style that you don't want.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  9. #9
    vrufusx65v's Avatar
    vrufusx65v is offline x10Hosting Member vrufusx65v is an unknown quantity at this point
    Join Date
    Aug 2009
    Location
    Dublin, Ireland
    Posts
    74

    Re: Quick search bar help...

    strike that, @font-face did work, just when it was live, apparently it doesn't like being active when you're just previewing it from its local roots via dreamweaver.

    Thanks for all the help, unfortunately i will back, probably with more stupid questions that need answered... =]

+ Reply to Thread

Similar Threads

  1. Replies: 0
    Last Post: 03-13-2010, 04:57 PM
  2. Quick file search engine, everything
    By openget in forum Computers & Technology
    Replies: 0
    Last Post: 12-24-2009, 03:31 AM
  3. Replies: 1
    Last Post: 02-03-2008, 12:29 PM
  4. Google Search engine or Yahoo Search engine?
    By satheesh in forum Crossfire
    Replies: 39
    Last Post: 12-06-2007, 11:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers