[Resolved] Change image URL depending on screen size ?

Home Forums Support [Resolved] Change image URL depending on screen size ?

Home Forums Support Change image URL depending on screen size ?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1675858
    Samuel

    Hi,

    Is it possible to change the branding image (logo) depending on screen size ?

    I have a menu a little bit special, and I would like to use 2 different images : one for large screens and another for @media max-width:900px

    Thanks for your help

    #1675878
    David
    Staff
    Customer Support

    Hi there,

    can you share a link to the site where i can see the layout and i can see whats possible.

    #1676906
    Samuel

    David, it was same site as my other topic. You’ll find it in private information.
    Now I decided to do other way but I’m still interested to know if this kind of things are possible and how to do it. 😉

    #1677052
    David
    Staff
    Customer Support

    The simplest method would be to use the Mobile Header which has its own logo:

    https://docs.generatepress.com/article/mobile-header/

    #1677080
    Samuel

    Yes obviously in that case it would have been an option, but I was talking like in general, is it possible to change an image url (not background-image) by css ?

    #1677115
    David
    Staff
    Customer Support

    No it’s not possible to change an <img> URL using CSS. You would need to output both Images and then use CSS to hide / display each one.

    #1677170
    Samuel

    Thank you David

    #1677173
    David
    Staff
    Customer Support

    You’re welcome

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.