Search code examples
htmlcssautoresize

Resizing an icon to fit an <input> field


I have an input field which has an icon inside of it, I did this by using css background

background: white url("user.png") right no-repeat;

the image is a bit big so I was wondering how do I resize the image to fit inside the <input> field.


Solution

  • background-size: cover or background-size: 100% 100%

    It is a property of CSS.