Change Style of One Blog Post Override Theme Text Align
-
Hi there, I have a line in my custom CSS to align the body text in my blog posts as justified. However, I’m working on a pillar piece of content, and I want to use a different style to my usual posts.
In the Gutenberg editor, I am centre aligning text, but when I publish, it is still justified as per my usual style. When I inspect the CSS I can see there is a strikethrough the ‘text-align:center’ and I don’t know how to override it.
Ideally, I could just use a CSS within the block on Gutenberg as it is a unique blog post and I don’t want to change the style for all posts (or even for all body text within this one post). I just want the ability to center align a few blocks of text in this post.
I’ve tried to many different combinations of CSS in the ‘additional CSS’ of the particular block in Gutenberg.
Any help would be much appreciated! This is the post I am referring to and I want to centre align the first few chunks of text/contents: https://sallysees.com/baja-california-sur-travel-guide/
-
Hi @sallyrodrick, good work on your site! I can see it isn’t created here on our services, so the support I can provided is limited. But I can say WordPress/Gutenberg will soon support the ability to define a template for a given post. That should help!
If you aren’t able to override with blocks in the meantime, try going to your block settings, “Advanced” and assigning a class there, then referencing that in your CSS. If necessary you could use !important for now :)
Going forward, these forums are for the sites hosted here on our servers. If you use other hosting, there is another forum for the free WordPress software. You can find that here:
https://wordpress.org/support/forums/And if you’d like more info about the difference between the WordPress software and the services by WordPress.com, we have more info here. Let us know if you have any questions about our services!
-
Hi there, I’m so sorry! I didn’t realise I posted on the incorrect forum. I have resolved the problem :)
-
Glad you’ve got it, and no worries — it’s pretty common to get the two confused.
Cheers!
- The topic ‘Change Style of One Blog Post Override Theme Text Align’ is closed to new replies.