Graphic that shows through text box on a form

D

David Wright

At http://www.itv.com/ they have a text box that forms part of a search
facility - but the text box has a visible graphic behind it.

When I put a text box in a form, it obliterates any graphics behind it.

I have not seen this on any other site - does anyone know how it's done?

D.
 
S

Steve Pugh

David said:
At http://www.itv.com/ they have a text box that forms part of a search
facility - but the text box has a visible graphic behind it.

When I put a text box in a form, it obliterates any graphics behind it.

I have not seen this on any other site - does anyone know how it's done?

A background image can be applied to an input box just the same as it
can be applied to any other element, via the CSS background-image
property.

You can also make a parent element's background show through by setting
the background property to transparent.

Simple demo: http://steve.pugh.net/test/test101.html

Be careful when setting backgrounds on form elements as anything that
makes it even slightly more difficult for the user to see what they're
typing is any obvious problem.

I can't be bothered to dig into the code of the ITV site, they write
the serch form into the page with JavaScript which shows just how
clueless they are.

Steve
 
?

=?ISO-8859-1?Q?L=FCpher_Cypher?=

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top