- This topic has 11 replies, 3 voices, and was last updated 3 years, 3 months ago by
David.
-
AuthorPosts
-
December 30, 2022 at 4:32 pm #2478447
Christian
Hello,
I am trying to adjust the spacing for the tablet view. There I have got two issues:
1. I wanted to hide the sidebar for mobile and tablet and set the following CSS code in the Customizer > Additional CSS.
@media (max-width: 1024px) { .sidebar { display: none; } .site-content .content-area { width: 100%; } }This first part applies because the sidebar is not displayed anymore for tablet. However, the second one to increase the width to 100% doesn’t apply for the tablet view. I still have 75% when checking with the console in the browser.
2. I have a grey background for the body and a white background for the content container. So, I have set left and right padding to 100px for the container in the Customizer > Layout > Container. On desktop it looks good but on tablet it’s too much. I can’t change it for tablet in the customizer settings. David said in another topic (https://generatepress.com/forums/topic/tablet-content-padding/) that such big paddings are not a good way to go for the content container. However, how can I achieve what I try to do esp. with the white body background. Or is it the only way to add some additional padding for the tablet view? I have found this code in the forum but it doesn’t work:
@media (min-width: 769px) and (max-width: 1024px) { .one-container .site-content { padding: 30px 50px; } }Thanks for your help!
December 31, 2022 at 5:02 am #2478732David
StaffCustomer SupportHi there,
can i see the site ? As adding 100px of padding either side of the container is going to cause some headaches, so we can look at alternatives to provide what you need.
December 31, 2022 at 5:13 am #2478745Christian
Hello David,
thanks for your reply! I set the information in the private information part of the topic.
Christian
December 31, 2022 at 6:24 am #2478800David
StaffCustomer SupportOk perfect. I would do the following:
1. Set the left and right padding back to a “normal” value eg. 30px ( adjust to suit ).
2. In Appearance > Elements -> Add New –> Layout Element.
2.1 On the Content tab leave the Content Area asDefaultand set the Content Width to1200px.
That will give you the same 100px space either size, but without the padding squeeze.
2.2 Set the Display Rules to:Posts -> All Posts.
Include any other places you want to apply it to.3. Now for some CSS to remove the Sidebar on smaller screens:
@media (max-width: 1024px) { .sidebar { display: none; } #content .content-area { width: 100%; } #content .content-area #main { margin-right: 0; } }January 1, 2023 at 6:44 am #2479558Christian
Hello David,
thanks for your help! It’s working!
Is there a way to control it for the right and left side separately? So that I have 100px on the left side and 50px on the right side for example?
Best regards
ChristianJanuary 1, 2023 at 7:31 am #2479599David
StaffCustomer SupportAre you wanting to narrow the main content so it sits more central ?
January 1, 2023 at 3:02 pm #2480027Christian
I actually want to give the content of the sidebar a bit more space on the right side and that’s why I would like to have a bit less padding on the right side for the content container.
January 1, 2023 at 9:03 pm #2480138Fernando Customer Support
Hi Christian,
If you’re looking to make the sidebar wider, you can alter it through Appearance > Customize > Layout > Sidebars. Reference: https://docs.generatepress.com/article/sidebar-layout-overview/
January 2, 2023 at 3:43 am #2480414Christian
Hi Fernando,
there I have only the possibility to set the width in general but not only the padding on the right side.
January 2, 2023 at 6:02 am #2480569David
StaffCustomer SupportSo i would do:
1. Increase the width of the right sidebar to 30%.
2. Add this CSS:.right-sidebar #content { margin-right: 20px; }This will increase the width of the right sidebar and it will consume the space to the right.
January 2, 2023 at 3:11 pm #2481257Christian
Thanks for very much your help! It’s working and I have got exactly what I wanted to achieve.
I really appreciate and enjoy your support! Definitely another reason why I will stick with Generatepress & blocks and recommend it to others. 🙂
January 3, 2023 at 3:05 am #2481698David
StaffCustomer SupportWe appreciate the kind words, glad to be of help !!
-
AuthorPosts
- You must be logged in to reply to this topic.