How can I make my form field have a background image?

拥有回忆 提交于 2019-12-25 18:14:03

问题


I added background: transparent; to the form field, however that also includes the image I'm trying to attach. When I use just the image, all I see is the regular form field. The field itself is like a sketchy underline, so that's why I need the image versus CSS styling. Can anyone please help?

Thank you!

*Update! I couldn't get my images to show up because I hadn't set the height / width on the field itself. But the underline is showing up. The image itself is a transparent png, but the white background of the input field still persists. Can anyone tell me how to make it transparent with the png on top?


回答1:


Try

background-image:url(xxx.png);
border:none;
background-color:transparent;

Not only "background"




回答2:


I added RGBA to the background and set the alpha to '0'! I hope this helps someone else out there. :)



来源:https://stackoverflow.com/questions/12875100/how-can-i-make-my-form-field-have-a-background-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!