Skip to content Skip to sidebar Skip to footer

How To Add A Img In A Text Field Value

I wanna show a picture inside the default value of a text field. this is what I've tried but it doesn't work.

Solution 1:

you need to put the image as the background of the element..

html

<input type="text" class="with-default" value="Word" />

css

input.with-default{
   background: url('../images/left_arrow.gif') 0 0 no-repeat;
}

Alternatively, if you are flexible about the actual arrow appearance, you could use a unicode char to display the arrow i.e. ⇐

for more unicode arrows: http://www.alanwood.net/unicode/arrows.html

demo: http://jsfiddle.net/6GyVM/


Solution 2:

Why do you want a picture inside a text field? If it's just a decoration, use CSS background image.


Solution 3:

this is for asp.net

http://www.bitrepository.com/how-to-add-a-stylish-icon-into-a-form-text-box.html


Post a Comment for "How To Add A Img In A Text Field Value"