0

I have a value input. We need to add an icon. What's the best way to do this?

<input type="button" class="upload" value="Choose File" />`

Now I'm adding positioning absolute:

img {
  position: absolute;
  left: 115px;
  top: 55px;                
}
<img src="/media/colour/group.png" alt="icon" title="arrow icon" />

enter image description here

Harshit Rastogi
  • 1,996
  • 1
  • 10
  • 19
Oleksii Zelenko
  • 2,311
  • 3
  • 7
  • 21
  • 1
    you can add the image using background-image for example, if you make some search you can find a lot of tutorials about it – Sfili_81 Sep 29 '21 at 10:05
  • https://stackoverflow.com/questions/18767633/is-it-possible-to-have-an-after-pseudo-element-on-a-button – Aman Sharma Sep 29 '21 at 10:08
  • 1
    You can use a ` – connexo Sep 29 '21 at 10:10

1 Answers1

0

You can use it like this:

input[type='button'] {
    background-image: url(/media/colour/group.png);
    background-position: 7px 7px;
    background-repeat: no-repeat;
}
Harshit Rastogi
  • 1,996
  • 1
  • 10
  • 19