Styling blocks specific to the page content area #48319
-
Is it possible to increase the gap between paragraph blocks in the only page content area? I asked on WordPress Stack Exchange first, here is the best, and only, answer so far.
This problem with this answer is it increases all the paragraphs on the whole page, some of which are in the header and footer. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
@johnhooks If you just want extra space in a specific place, the Spacer block might be sufficient |
Beta Was this translation helpful? Give feedback.
-
I appreciate the response, but I'm trying to style all pages and posts, increasing the gap between all top level blocks of the content. Dropping spacer blocks in while writing content isn't a solution for this problem. |
Beta Was this translation helpful? Give feedback.
-
This sounds like something that can be solved by adding just a single spacer in the template for the single. Another approach can be selecting the first block with the nth-child selector in CSS. For a more global approach on handling block spacing, check this blogpost by 10up. Edit: one more additional method would be to add a custom class to every block you want to give additional spacing, and adding some custom global styles for that class. |
Beta Was this translation helpful? Give feedback.
-
I'll attempt this. If a spacer is put in the template's post content it will insert one between all the top level blocks? Also, thanks for the link to the 10up best practices. It looks like a gold mine of good information. |
Beta Was this translation helpful? Give feedback.
@johnhooks
This sounds like something that can be solved by adding just a single spacer in the template for the single. Another approach can be selecting the first block with the nth-child selector in CSS. For a more global approach on handling block spacing, check this blogpost by 10up.
Edit: one more additional method would be to add a custom class to every block you want to give additional spacing, and adding some custom global styles for that class.