Site logo

Archived topic

How to Left-Align All Headings

19 replies · Started by Mihail on January 17, 2022

Viewing posts 1–15 of 20

Hello,

I want to left-align headings H2, H3, H4, H5, and H6. I can left align manually, going from post to post, however it will take a lot of time.

I've tried a CSS you mentioned on : https://generatepress.com/forums/topic/css-for-centering-all-header-tags/ , but I changed center, to left, so it looks like this:

h2, h3, h4, h5, h6 {
text-align: left;
}

However, it doesn't seem to left-align the headings in my articles.

How should I proceed?

Any help will be appreciated.

Hi there,

all headings should be left aligned by default.
Can you share a link to a page where i can see them ?

Aah those headings have inline styles - so you gonna need to use some !important in your CSS:

h2, h3, h4, h5, h6 {
    text-align: left !important;
}

Thank you David, everything works well now!

Glad to hear that!

Hello David!

I am sorry to inform you but the changes didn't affect the headings on mobile. Some of them are still center-aligned.

The headings are successfully left-aligned only on desktop.

What may cause the issue?

Thank you in advance!

Thank you for the reply Leo.

I am really sorry, but I am not quite familiar with editing CSS. I am afraid I might mess something up.

If you don't mind, I provided temporary credentials for my website, as I find it more comfortable for you to check whether there is a missing closing bracket } that needs to be added.

Any help will be appreciated.

Thank you, David and Leo! This is amazing. Everything works well now!

Many thanks!

No problem :)

Hello,

I am sorry, but even though I added a closing bracket at line 28, the headings aren't left-aligned on mobile once again. I haven't changed anything in the Additional CSS since adding the closing bracket there.

Here is a screenshot of the Additional CSS window: https://imgur.com/jq9nn4B

What may cause the issue?

Thanks in advance!
Mihail.

Thanks for the quick reply!

I tried the suggestions above, however, the headings are still centered and not left-aligned on mobile.

Here are images of the Additional CSS: https://imgur.com/a/W0qIzZD

What should I do next?

Thanks

This archived topic is closed to new replies.