Place an image inside a text field

后端 未结 10 911
夕颜
夕颜 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:16

    .text3 {
    	width: 300px;
    	height: 30px;
    }
    
    #text3 {
    	background-image: url(https://cdn3.iconfinder.com/data/icons/interface-8/128/InterfaceExpendet-09-128.png);
    	background-size: 30px;
    	background-repeat: no-repeat;
    }
    
    input {
    	text-align: center;
    }
    
    

提交回复
热议问题