saidmrn
December 25, 2017, 12:43am
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 !
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.
saidmrn
December 25, 2017, 2:03am
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/>
robinyo
December 25, 2017, 2:43am
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:
saidmrn
December 25, 2017, 3:14am
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 ?
robinyo
December 25, 2017, 3:27am
6
1 Like
saidmrn
December 25, 2017, 3:41am
7
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