Place an image inside a text field

后端 未结 10 925
夕颜
夕颜 2021-02-04 04:15

I have an HTML input field like this. I would like to place an image inside the textbox on the right side. Can someone help me out with its CSS for that?



        
10条回答
  •  心在旅途
    2021-02-04 04:27

    Use background-image and background-position property

    DEMO

    CSS:

    input  {
         height: 70px;
         width: 200px;
         background-image:url("http://cloud.ohloh.net/attachments/25869/plone-icon-64_med.png");
         background-repeat:no-repeat;
         background-position: 133px 3px;
    
    }
    

提交回复
热议问题