Archived topic
Padding Left/Right Non Mobile
9 replies · Started by Sean on May 23, 2016
I know this is probably a strange one. So I'm looking to add padding on the left and right side of the website. Padding that would be transparent, and expose the background image that I have selected picked for Body. I thought it would be an option in Element Spacing, no luck. But I want like 20px padding on both sides while viewing the website in desktop view. While in mobile/tablet view however, the website will not have padding.
You could try something like this:
@media (min-width: 769px) {
body {
padding-left: 20px;
padding-right: 20px;
}
}
Works Flawlessly, thank you.
You're welcome :)
Hello
I have a very similar problem.
I want to have a padding-left of 100px in the desktop version and only 20px in the mobile version.
I can not fit it with the element spacing neithe with the CSS.
May I have to deactivate the element spacing in order to get this code will work?
@media (max-width 768px) {
.one-container .site-content {
padding-left: 10px;
padding-right: 10px;
}
}
@media (min-width: 769px) {
.one-container .site-content {
padding-left: 100px;
padding-right: 100px;
}
}
My website is: elcucharonverde.com
Thanks in advance.
Lada
Hi there,
I think we need a Mobile Spacing section with the spacing add-on.
Make your CSS a little more specific:
@media (max-width 768px) {
body.one-container .site-content {
padding-left: 10px;
padding-right: 10px;
}
}
Thanks
I'm going to test it
No problem :)
Thank you so much Tom
It works perfectly
Lada
You're welcome :)
