Site logo

Archived topic

Sections margins and padding

3 replies · Started by ch1800 on April 15, 2021

Viewing posts 1–4 of 4

Hello,

This homepage has 6 sections, 3 with texts and 3 hero.

For the text sections I would like to add left+right margins for desktop view only.
I tried this with no success as they also apply to mobile view:

@media( max-width: 768px ) {
 #generate-section-1 .generate-sections-inside-container {
    margin-left: 6%;
    margin-right: 6%;
}
} 

And for the hero sections I would like to add left+right padding for inside container (not the background) also for desktop view only.
I tried this with no success either:

@media( max-width: 768px ) {
#generate-section-2 .generate-sections-inside-container {
    padding-left: 10%;
    padding-right: 10%;
}
}

I'm adding this at the page's CSS only, not at global.

Thanks.

Hi there,

You're using the @media rule for mobile.

The media rule for tablets and desktop is @media(min-width:769px)

and if for tablets only, its @media(min-width:769px) and (max-width:1024px)

and if for desktop only, its @media(min-width:1025px)

Ha, yep, many thanks for this!

No problem. glad to be of any help. :D

This archived topic is closed to new replies.