Page 1 of 1

BG Image into search box

Posted: Fri Aug 03, 2007 10:34 am
by themasterofthedisaster
Enter here (http://www.softonic.com) and you can see in the search box there is a background image. How can i make this???


Watch this:

Image

I think it javascript but I realy doesn't know! Thanks

Posted: Fri Aug 03, 2007 10:43 am
by John Cartwright
Simple CSS, using the background-image attribute

Posted: Fri Aug 03, 2007 11:54 am
by themasterofthedisaster
I don“t know nothing about CSS programming. Could you write me the script please? Thanks.

Posted: Fri Aug 03, 2007 12:00 pm
by John Cartwright
I'll help you out this time, but in the future all it takes is a tiny amount of effort to research on google. There are thousands of examples.

Code: Select all

<input type="input" style="background-image: url(/path/to/image.jpg");" />

Posted: Fri Aug 03, 2007 1:19 pm
by themasterofthedisaster
this is what Ive made:

Code: Select all

<form action="<?php echo $_SERVER['php_self']; ?>" method="post">
		<label for="userid">Username</label>
		<input type="text" name="username" id="username" style="background-image: C:/treue.gif" />
		<br />
It desnt work!!!
P.D: There isnt any tutorials for it in google!!!

Please help!

Posted: Fri Aug 03, 2007 1:22 pm
by miro_igov
8O

Note that you should address the image relatively to the web root.

Posted: Fri Aug 03, 2007 1:26 pm
by John Cartwright
There actually are thousands of examples

Posted: Fri Aug 03, 2007 2:01 pm
by themasterofthedisaster
For those with the same problem like me enter here: http://www.picment.com/articles/css/funwithforms/
Its greate!