Difference Between Img And Ion-Img Tag In Ionic

Difference Between Img And Ion-Img Tag In Ionic

Table of Contents

ionic comes with a lot of own components like ion-header, ion-footer, ion-button, ion-img, ion-text etc. and in html we also have many tags like p, span, div, b, img ,ul, li, figure etc.

here are some Difference Between Img And Ion-Img Tag

    1. img  is a standard HTML element
    2. The ion-img is a component that is similar to the standard element, but it also adds features in order to provide improved performance.
    3.  if there are only a few images to be rendered on a page, then the standard tag is the best choice.
    4. if a page has the potential for hundreds or even thousands of images within a scrollable area, then would be better suited for the job.
    5. each ion-img uses the object-fit: cover CSS property. What this means is that the actual rendered image will center itself within it’s container.
    6. add ion-img-cache attribute to img tag you want to cache.

Leave a Comment

Your email address will not be published. Required fields are marked *

No data found.