IONIC Increasing Image Size

Hi guys,i’m having problems with the size of an image.
my image is 24X24 but the ionic is increasing its size.

I’m using this code :
<img src="assets/imgs/star.png" style="background: transparent !important;" item-start/>

But ionic display :
IMAGE

when i need it :
result

Thanks !

Hello,

img tag has height and width property. Use it, when you need specific dimensions.
https://www.w3schools.com/tags/tag_img.asp

Best regards, anna-liebt.

Hello ! Thanks for the fast response !
I tried it and the result is the same.

<img width="24" height="24" src="assets/imgs/star.png" style="background: transparent !important;" item-start/>


Why not use:

  <ion-row>
    <ion-col>
      <button ion-button color="primary" clear small icon-start>
        <ion-icon name='star'></ion-icon>
        ...
      </button>
    </ion-col>

    ...

  </ion-row>

See:

it’s worked,thanks !
but if i want another icons that i couldn’t find on the ionic docs ?
how i will resolve this problem ?

See: https://fontawesome.com/

1 Like

Wow I didn’t know this website.
It will resolve my problem. Thanks!!!

Hello,

fine that a other solution works for you.

Bytheway sometimes it is for me necessary to stop ionic serve and start it again that changes on code are updated. Because If you give the image a specific height and width and nothing else overwrite it, it should displayed with our values.

Best regards, anna-liebt.

1 Like