Headline Centering

I’ve tried some solution with centering Headline Text.

But the headline text still doesn’t shrink as it should!

Bildschirmfoto 2022-12-20 um 16.17.36

Hello @Regnalf,

Thanks for writing to us.

In order to align the Headline text in the center I would suggest you please set the containing column’s Flexbox “Horizontal” as “Center”.

Test-Page-Builder-Pro (37)

If it doesn’t work for you, we need to check your settings, I would request you, please share your details in a secure note. Please provide the following details meanwhile you must troubleshoot a few common issues before we investigate your settings.

  • WordPress Login URL
  • Admin-level username and password
  • Exact page URL

You can find the Secure Note button at the bottom of your posts

Thanks

Well that’s excactyl what i did, and it did center the element when in desktop size.
But you still can see that it’s not centering correctly on small screen, (this extra space on the right side).

I’ve tried with the flex settings and with fit-content, but nothing worked.

I’ve added the credentials in sn.

Hey @Regnalf,

Your headline is actually still centered, even on mobile devices. You just don’t see it because the headline spans the width of the small screen and the text in the headline is left aligned so it looked like the headline is positioned on the left.

The solution that I see is you set the Headline Width to 200px so it will be centered like on desktop.

If that is not what you’re expecting, please tell us what you want to accomplish on mobile like you can reduce the font size on the smallest screensize to make the headline take 2 lines only. It’ll sacrifice the readablity though.

Thanks.

Yes, that the element is basically centered is already clear.

My question is whether this unnecessary space that arises when wrapping a text line can be avoided. The h1 element fills the area, although it actually needs less space.

Bildschirmfoto 2022-12-21 um 14.26.20
space-not-needed

This is how it should look like in the final:

final

I didn’t find a way yet to tell the element it should fit the text width. “fit-content” property didn’t work.

Hey @Regnalf,

In your Headline element settings, set the width to auto and the maximum width to 100%.

Hope this helps.

No, that doesn’t change anything with the width of the text!


Hey @Regnalf,

I wonder if you have tested what I suggested previously because it looks close what you’re looking for.

Kindly test it out and let us know what is wrong with the suggestion. And remember that you can set different values per screen size as shown in my screenshots. It also does not have to be 200px. The idea there is you set a fixed Width or even Max Width.

Thanks.

Yes, i tried your suggestion. But it is not what i want to achieve.

I want the header to extend as far as possible on desktop level, without wrapping and without fixed width.

On smaller screens, the text may wrap, but the entire element should remain centered.

image

The issue is still that remainig space in the text element:

image

Hey @Regnalf,

What I suggested is exactly what you need as you can see in my screenshots.

In my previous screenshot, you will only apply a fixed with IN mobile screens.

Again, in my suggestion, you only apply a fixed Width or even Max Width on mobile screens. What you want to accomplish is what’s shown in my screenshot.

Restricting the Headline’s Width or Max Width in combination with reducin the Font Size (on mobile) is the only solution on mobile screen sizes.


And lastly, as I’ve said, please kindly set it up and show us the problem with it.

Thanks.

I have 2 problems with it unfortunately. One is that this solution is bound to only one headline element, and I have to set it for each headline separately.

The second, unsolvable problem, is that it is planned to make the website multilingual. So the solution with a fixed width is not applicable.

I understand by now that it is not a theme.co theme problem, but a general one how elements are rendered.
Also i found something with JavaScript solution, but I’m not sure if it works yet.

If you know another solution besides the one with JavaScript that only works with settings via Cornerstone I would be very happy about it.

In the worst case I would have to try it with another element than Headline.

thanks, Regnalf

Thanks for sharing those 2 additional factors, Regnalf. In that case, there would be some calculation involved or other techniques, whether using custom CSS or JS. Regretfully, that is beyond the scope of our theme support to cover. We can provide guidance on this in One.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.