IONIC Increasing Image Size


#1

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 !


#2

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.


#3

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/>



#4

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:


#5

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 ?


#6

See: https://fontawesome.com/


#7

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


#8

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.