Center align content
-
Hi,
Some of my pages does not align to the center like I wish it would. My front page is nicely centered, but when I click “Scouting reports: Joel Jonsson”, the page is left-aligned. I should add that I use the same template for both my front page and this page. Probably it is something in the theme that sets the page up this way. Is there any method to use for center aligning also my pages that I reach through the menu? If someone could shed some light on this I would be very happy!
Site: swedishprospects.com
Best,
JacobThe blog I need help with is: (visible only to logged in users)
-
Hello!
When I click “Scouting Report: Joel Jonsson”, I can see that the page is centered. Clear the browser cache and look again.
-
Hi,
Thanks for you reply!
That is odd. Still the same problem for me even with the cache cleared. Are you using a computer or a phone? I noticed that it looks fine on a small screen, but the alignment issue arises when the screen is wide enough.
Best,
Jacob -
I should also make it clear that the front page looks fine, but when accessing the same post through the front page menu (Scouting report -> Scouting reports: Joel Jonsson) it is left-tilted.
Jacob
-
I was checking this page https://www.swedishprospects.com/2021/11/06/scouting-report-joel-jonsson/
I can see that the text is the same. You can put the link with the centered text in the website menu.
-
Yep. That works fine. Thank you!
Seems like pages are aligned to the left but posts are centered. Any idea how I can get the pages centered as well?
Thanks again,
Jacob -
I noticed that your other pages are not centered either.
I see that you use the Allura theme and Elementor on your website.
If you created a page with Elementor builder look at this tutorial https://www.youtube.com/watch?v=eCs6ay5k9jc
You will see how you can center elements on the page.
-
This tutorial is better https://elementor.com/help/section-column-vertical-and-horizontal-alignment/
Look at the video.
-
When you click on the text or title block on the page you will see the layout. Then go to horizontal align.
-
I´m afraid that video didn´t help. It also looked different for me in the Elenentor. I now tried to delete Elementor to see if it worked, but not much luck.
Jacob
-
-
Tried to play with this for a while now. Don´t know why my layout tab doesn´t look like the one in your latest video linked. Checked to update elementor but that is not the problem.
Jacob
-
-
-
Yeah I have tried those. Funny thing is that I use the same template for the posts and the pages with the post being OK and the page not.
Jacob
-
Try to add this code in the Theme Customizer in the Additional CSS field.
.site-content {
max-width: 860px;
margin: auto;
} -
Thanks! You´re definitely on to something. This however set the left margin to be zero, with even more space on the ride hand side. I tried to use a code like the one below, but the margin command does not seem to do anything. Why is that?
.site-content {
max-width: 840px;
margin: 10px 150px 15px 150px;
}Jacob
-
It is because your website margins are already set through the theme so you have to put !important after the margin value like this:
.site-content {
max-width: 840px;
margin: 10px 150px 15px 150px !important;
} -
-
Hi Jacob,
I’m glad you got it sorted out. Just for future reference, though, you posted your request in the forums for the hosting provider, WordPress.com, and your site is using the open source WordPress software at another host. Your version of WordPress is made and supported by the community over on WordPress.org.
The general support forums on WordPress.org can be found at https://wordpress.org/support/forums/
But for an issue like what you posted above it’s generally best to contact support for the specific theme you’re using, as site layout is controlled by your theme.
And for issues with the Elementor plugin, you can find the support forum for their free version at https://wordpress.org/support/plugin/elementor/
- The topic ‘Center align content’ is closed to new replies.