- This topic has 9 replies, 2 voices, and was last updated 3 years ago by
Ying.
-
AuthorPosts
-
March 15, 2023 at 6:38 am #2568496
scometamus
Dear GP-support team,
on a single page I’d like to center the content. Currently everything is at the top, but I’d like to have it centered in the middle of the screen on desktops and tablets. For mobile this obviously wouldn’t apply, there the vertical alignment is nice.
How do I do this though? I fiddled around with the Layout element and the container alignment, but for the latter it looks different on computer sizes or at least I didn’t manage to fully center it.
Thanks in advance!
March 15, 2023 at 9:04 am #2568782Ying
StaffCustomer SupportHi there,
1. Add this CSS:
@media (min-width: 1025px) { .home .entry-content { display: flex; align-items: center; min-height: 100vh; flex-wrap: wrap; justify-content: center; } }2. Set the container block the
flex-basisto100%.
https://docs.generateblocks.com/article/layout-options-overview/#flex-1March 15, 2023 at 9:27 am #2568803scometamus
That worked perfectly, thanks!
March 15, 2023 at 9:42 am #2568834scometamus
One follow-up question: Now on the site the copyright text (implemented via custom html) is not centered anymore, although the headline above is. Instead the copyright text is attached to the right of the images.
March 15, 2023 at 9:50 am #2568846Ying
StaffCustomer SupportI have updated the solution here:https://generatepress.com/forums/topic/center-content-to-the-middle-of-a-page-desktop/#post-2568782
Try the new solution and let me know how it goes.
March 15, 2023 at 10:18 am #2568881scometamus
This unfortunately did bring everything back to the beginning. So the content is not centered in the middle of the page anymore.
March 15, 2023 at 11:21 am #2568955Ying
StaffCustomer SupportOops, I’m sorry, there was a syntax error in my code, I’ve updated it again 🙂
March 15, 2023 at 11:25 am #2568959scometamus
Oh! Haha saw it too now, perfect. It’s in the middle and centered again!
However, the copyright container is still on the right side.
March 15, 2023 at 11:32 am #2568966scometamus
Update: Couldn’t solve the issue by its core, but in a roundabout way: For simplicity I wanted to change the copyright container to an element so I don’t have to take care on it on each site. So when I do this, it is centered correctly as the rest of the content.
March 15, 2023 at 11:57 am #2568993Ying
StaffCustomer SupportFor simplicity I wanted to change the copyright container to an element so I don’t have to take care on it on each site.
This is the right thing to do 🙂
Glad you’ve sorted out!
-
AuthorPosts
- You must be logged in to reply to this topic.