- This topic has 6 replies, 2 voices, and was last updated 7 years, 2 months ago by
Tom.
-
AuthorPosts
-
January 15, 2019 at 3:00 pm #783049
blackbird
Hi, this is probably very easy, but I´m not sure about the best CSS-solution to this:
I have a left sidebar on almost every page/post, but some pages is without any sidebar (like the static frontpage). When there is a sidebar I want more space/air between the left sidebar and the content (including the featured image!). I am pleased with the sidebar width and all other global spacing and padding, so I don´t like to affect that. I just want to make the content more narrow (“moving the left side of the content more to the right”).
But it must not effect the content on pages that does not have any left sidebar, like the frontpage! If I just add more left-padding to the content, that will also effect the pages without sidebars making them looking off (of course with more padding to the left than to the right).
How pinpoint only page/post content that does have a sidebar? And should I add padding or margin?
January 15, 2019 at 4:55 pm #783121Tom
Lead DeveloperLead DeveloperHi there,
Your website doesn’t seem to be viewable right now.
Have you tried the Separating Space option?: https://docs.generatepress.com/article/separating-space/
Let me know 🙂
January 15, 2019 at 5:39 pm #783134blackbird
It was in maintenance, now it is back.
I have separating space set to 20px, content padding set to 20 px left and right, sidebar widget padding set to 20 px left and right. But still I am not happy 😉
I like to add an “asymmetric” extra left padding to content, to make more space between it and the sidebar, but not if there is no sidebar.January 15, 2019 at 5:50 pm #783136blackbird
Or another solution might be to increase the separating space option as you said, but somehow with CSS remove/change the top and bottom spacing that also gets extra added. Because I do not want more air at the top between the content and the header (or the hero image).
January 15, 2019 at 9:17 pm #783199Tom
Lead DeveloperLead DeveloperGive this CSS a shot:
.left-sidebar.separate-containers .site-main { margin-left: 40px; }Let me know 🙂
January 16, 2019 at 5:32 am #783460blackbird
Yes! That did the trick! (I have not implemented it live yet, but have tried it.)
I did find a lot of other CSS trix in the support forum, but not exactly this target.
Solved, thank´s!
January 16, 2019 at 9:37 am #783836Tom
Lead DeveloperLead DeveloperYou’re welcome 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.