Is it possible to set a background image on a form text box with CSS?
- Will
| SitePoint Sponsor |



Is it possible to set a background image on a form text box with CSS?
- Will

Check out this tutorial at edevcafe



Nah, that's not what I wanted. Thanks anyway, but I knew all of what was in that tut. What I was wondering was, is there a way (in CSS) to set a background image for a text box? I don't think there is; I think it's only for buttons. But if anyone has any ideas please let me know.
Cheers,
- Will
Have a look at this
http://www.richinstyle.com/oldtest/color/forms.html
DCE
If everything seems to be going well, you have obviously overlooked
something.



Thanks, that's exactly what I wanted. But now I need the image not to repeat and to align to the right of the text box. Any ideas?
- Will
Could you not make the image exactly the same size as the text box with white(or coloured) space to the left of the original image?
DCE
If everything seems to be going well, you have obviously overlooked
something.



No, it's ok. I already worked it out. This is how it's done for anyone wondering:
.required { background: url(gfx/arrow.gif);
background-position: center right;
background-repeat: no-repeat;
background-color: #f0f0f0;
border: 1px solid;
border-color: #0080ff;
font-family: verdana;
font-size: 10px;
color: #ff0000;
}
Thanks for eveyones help.
- Will
Bookmarks