Skip to content

Picture element + different formats #152

@koseduhemak

Description

@koseduhemak

Chrome does load jpg instead of webp even the webp is provided.
Markup:

<picture>
    <source data-srcset="/dist/images/categories/historika_master.webp" type="image/webp">
    <source data-srcset="/dist/images/categories/historika_master.jpg" type="image/jpeg">
    <img src="/dist/loading.gif" data-src="/dist/images/categories/historika_master.jpg" class="card-img-top lazy-load category-slide" alt="Historika, Studentika, Militaria" title="Historika, Studentika, Militaria">
    <noscript>
        <img src="/dist/images/categories/historika_master.jpg" class=" card-img-top -slider category-slide" alt="Historika, Studentika, Militaria" title="Historika, Studentika, Militaria">
    </noscript>
</picture>

Is there anything I can do to force supported browsers to load the webp format?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions