BG Image into search box

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
themasterofthedisaster
Forum Commoner
Posts: 31
Joined: Mon Jul 09, 2007 6:23 am

BG Image into search box

Post 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
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Simple CSS, using the background-image attribute
themasterofthedisaster
Forum Commoner
Posts: 31
Joined: Mon Jul 09, 2007 6:23 am

Post by themasterofthedisaster »

I don´t know nothing about CSS programming. Could you write me the script please? Thanks.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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");" />
themasterofthedisaster
Forum Commoner
Posts: 31
Joined: Mon Jul 09, 2007 6:23 am

Post 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!
miro_igov
Forum Contributor
Posts: 485
Joined: Fri Mar 31, 2006 5:06 am
Location: Bulgaria

Post by miro_igov »

8O

Note that you should address the image relatively to the web root.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

There actually are thousands of examples
themasterofthedisaster
Forum Commoner
Posts: 31
Joined: Mon Jul 09, 2007 6:23 am

Post by themasterofthedisaster »

For those with the same problem like me enter here: http://www.picment.com/articles/css/funwithforms/
Its greate!
Post Reply