Site logo

Archived topic

discriminate a different header from "Elements" on desktop and mobile

9 replies · Started by Patricia on August 9, 2019

Viewing posts 1–10 of 10

Hello!

Is it posible with the "Elements" feature to place a header only for desktop/mobile? if it is, how?

I want to place a title and an image on the frontpage of my blog, which i already did placing a header but it is not very well displayed on mobile so i want to place a different image just for mobile

Thanks!

hello!

it worked perfectly, but y need to change the responsive breakpoints for tablet, just for this, not for the rest of the site...

what code should i use?

i've tried as follows but it does not work (sorry i know almost nothing about CSS:

<div @media (min-width: 1025px) {
display: none;
}>

Not quite sure if I fully understand.

So you are trying to change the breakpoint of where the image switch?

hello again Leo

yes, for example mobile until 449px, tablet from 450px to 799px and desktop from there

but just for this, not for the rest of the settings of the template

is it possible?

thanks

Hi there,

to change out the background image would require some CSS like so:

@media (max-width: 450px) {
    .my-hero-custom-class {
        background-image: url(full_url_to_image/image.jpg);
    }
}

Give the header an Element class of my-hero-custom-class or whatever you want to name it to target that one specifically.

Aah sorry my bad for not reading the topic....

So you can create your own custom classes for that purpose:

@media (max-width: 449px) {
    .custom-hide-mobile {
        display: none !important;
    }
}
@media (min-width: 450px) and (max-width: 799px) {
    .custom-hide-tablet {
        display: none !important; 
    }
}
@media (min-width: 800px) {
    .custom-hide-desktop {
        display: none !important;
    }
}

Now you can use custom-hide-mobile etc. in place of the GP included classes.

thank you David, that works perfectly!! <3

Glad we could be of help

This archived topic is closed to new replies.