How to disable text-align for post-content

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #5104
    krsna18
    Participant

    I 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>
    ….’

    #5140
    Theme Century
    Keymaster

    Hello 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.

    #5154
    krsna18
    Participant

    This worked.

    Thank you.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.