[Resolved] Change section background image on different viewports.

Home Forums Support [Resolved] Change section background image on different viewports.

Home Forums Support Change section background image on different viewports.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #393981
    Max

    Hey Tom and Leo

    I need to display a different background image in a section depending if site is viewed in mobile, tablet or fullscreen.

    I am already familiar with the @media breakpoints.

    I just need to know what css to use to identify a specific section background image.

    Thanks for your kind assistance.

    Regards

    Max

    #393985
    Max

    I have come up with this.

    Is it correct?

    @media (max-width: 768px) {
        #generate-section-6 {
        background-image: url('https://mywebsite.com/wp-content/uploads/2017/09/myimage-1920-1080.jpg') !important;
    }} 

    Thank you for your assistance.

    Max

    #393992
    Tom
    Lead Developer
    Lead Developer

    Yep – that works. You can give the section a custom class or ID as well so you don’t need to use #generate-section-6

    #393994
    Max

    Thanks

    #393999
    Tom
    Lead Developer
    Lead Developer

    No problem!

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