Edit CSS of element for mobile

Hello,

I put

@media only screen and (max-width: 600px) {
body {
margin-bottom: 20px;
}
}

in the CSS of a button on my site (under the customize button after the element has been selected in Cornerstone) to try to make it have a larger bottom margin on mobile, but it’s not working. Not sure if I’m writing that correctly, any help would be appreciated.

Just to clarify: I’m trying to add some margin space below a specific button but only on mobile.

Thanks.

Hey Greg,

It’s not recommended to use custom code for structural parts of the document like the body. We also do not provide support for custom codes.

What I’d recommend is you add a Gap element below your button. Then, hide the Gap element on desktop and laptop views using the Hide During Breakpoints feature. The Gap element acts as a responsive spacer this way.

Hope that helps.

1 Like

That was a great fix, thank you.

Glad that we could be of help.

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.