No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Responsive images

    Help
    1
    1
    125
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • PeterQF
      PeterQF last edited by

      So, this works. Dragging the window lower than 800px changes to image 1x:

        <picture>
              <source media="(max-width: 799px)" srcset="https://cdn.quasar.dev/img/image-1x.png">
              <source media="(min-width: 800px)" srcset="https://cdn.quasar.dev/img/image-2x.png">
              <img src="https://cdn.quasar.dev/img/image-src.png" style="height: 255px">
            </picture>
      

      but this from docs won’t work:

      <q-img
              src="https://cdn.quasar.dev/img/image-src.png"
              srcset="https://cdn.quasar.dev/img/image-1x.png 799w,
                      https://cdn.quasar.dev/img/image-2x.png 800w"
              sizes="(max-width: 799px) 799w,
                    (min-width: 800px) 800w"
              style="height: 255px"
            >
              <div class="absolute-bottom text-body1 text-center">
                With srcset & sizes
              </div>
            </q-img>
      

      what am i doing wrong?

      1 Reply Last reply Reply Quote 0
      • First post
        Last post