Place an image inside a text field

后端 未结 10 899
夕颜
夕颜 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

    try this:

    input { 
      background-image: url("icon.png");
      background-position: right top;
      background-repeat: no-repeat;
      background-size: contain;
    }
    

提交回复
热议问题