- This topic has 7 replies, 3 voices, and was last updated 4 months, 3 weeks ago by
Elvin.
-
AuthorPosts
-
October 11, 2020 at 8:49 am #1483473
Andy
Hi there,
I use this code for reducing margins:
@media (max-width: 768px) { body:not(.home).separate-containers .site-main { margin-top: 0; } }
It successfully ignores the homepage and targets my single blog posts. Unfortunately, I’ve realized, the code still targets my category pages. I’d like to ignore both the homepage and category pages.
How do I edit this code to also exclude my category pages? Thank you!
October 11, 2020 at 11:26 am #1483675Tom
Lead DeveloperLead DeveloperHi there,
Try this:
@media (max-width: 768px) { body:not(.home).separate-containers .site-main, body:not(.archive).separate-containers .site-main { margin-top: 0; } }
Let us know 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentOctober 11, 2020 at 12:21 pm #1483735Andy
Hi Tom,
Thank you, I tried this out but it didn’t work out, and I noticed it ignores the original
body:not(.home)
logic as well (mobile view). What are your thoughts?I’ve shared the homepage and category pages in ‘Private information’ below. Thanks!
October 11, 2020 at 2:16 pm #1483827Andy
Hi Tom,
Just following up — I did some more testing.
It appears that the custom CSS does not work when both
body:not(.home)
andbody:not(.archive)
are applied simultaneously.Interesting enough, if I apply one of these conditions, it works. They just don’t work at the same time. I’m stumped.
October 11, 2020 at 2:24 pm #1483836Elvin
StaffCustomer SupportHi,
Just following up — I did some more testing.
It appears that the custom CSS does not work when both body:not(.home) and body:not(.archive) are applied simultaneously.
Interesting enough, if I apply one of these conditions, it works. They just don’t work at the same time. I’m stumped.
That’s strange. If that’s the case, you can try this:
@media (max-width: 768px) { body:not(.home).separate-containers .site-main { margin-top: 0; } body:not(.archive).separate-containers .site-main { margin-top: 0; } }
A wise man once said:
"Have you cleared your cache?"October 11, 2020 at 3:31 pm #1483888Andy
Hi Elvin,
Still doesn’t work when both are applied.
If one is applied it works, but not both. Pretty strange, I agree. I’ve included the links for you to take a closer look.
October 11, 2020 at 5:06 pm #1483949Andy
Hey guys, i’m gonna mark this as resolved. I’ll experiment with some different CSS. No worries. Thank you
October 11, 2020 at 5:25 pm #1483960Elvin
StaffCustomer SupportHey guys, i’m gonna mark this as resolved. I’ll experiment with some different CSS. No worries. Thank you
That’s strange.
You can link us to the site to check further if in case you need more assistance regarding this.
Feel free to open a new topic if you have other concerns.
A wise man once said:
"Have you cleared your cache?" -
AuthorPosts
- You must be logged in to reply to this topic.