How to disable text-align for post-content
- This topic has 3 replies, 3 voices, and was last updated 3 years, 3 months ago by
DavidWilson.
- AuthorPosts
- July 3, 2021 at 11:15 pm #5104
krsna18
ParticipantI am importing my HTML site to WordPress with Slain theme. I want to maintain the alignment as set on my tags instead of the one set by CSS. The post-content class is overriding my alignment setting to justify. I can override with this
.post-content > p {
text-align: left;
}However, I also have <p align=”center”> and sometimes <p align=”right”> in my HTML file. How can I maintain the alignment? My code looks like this:
‘<div class=”main-container”>
<article id=”page-205″ class=”post-205 page type-page status-publish hentry”>
<header class=”post-header”>
<h1 class=”page-title”>Title</h1> </header>
<div class=”post-content”>
<h2 align=”center”>Title</h2>
<p align=”center”>By</p>
<h3 align=”center”>Author
<p align=”left”><i>These twenty …</i></p>
<p align=”center”><b>1. Instruction</b></p>
<p align=”left”>Text.</p>
<p align=”center”><b>2. Method</b></p>
<p align=”left”>Text.</p>
….’July 21, 2021 at 3:33 am #5140Theme Century
KeymasterHello Krsna,
Could you please try to put this css this css may help you to solve your problem. and let us know if you have any problem. We are here to help you..post-content > p { text-align: initial; } .post-content > p[align=center] { text-align: center; } .post-content > p[align=right] { text-align: right; } .post-content > p[align=justify] { text-align: justify; }
Thank you.
July 25, 2021 at 1:00 am #5154krsna18
ParticipantThis worked.
Thank you.
November 10, 2021 at 10:30 am #5341DavidWilson
ParticipantThank You for sharing this post. This is very useful for me, actually, I was looking for the same. We provide the solution for how to Change AOL Mail Password by the easy and quick method.
- AuthorPosts
- You must be logged in to reply to this topic.