WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] how to allign content as "Justice" in microsoft office word (18 posts)

  1. cgupta
    Member
    Posted 1 year ago #

    Hi,

    i have written a post in Microsoft office word and pasted it in the word-press editor. Post publish, i found that the contents are left aligned and it look weird (www.topsmartideas.com). Could anyone suggest me how to have the content aligned as "Justice"(align text to both the left and right margin) as in Microsoft office word.

    Thanks

  2. Krishna
    Volunteer Moderator
    Posted 1 year ago #

    It is not a good idea to use Microsoft Office Word as an editing tool to format text and paste it directly to the WordPress Editor box because the text may carry its own syntax and cause unexpected results. If you need to use it, after completing your text in MS Word, paste it on to a plain text editor like notepad and from notepad cut & paste again on to the dashboard editor and do further formatting there.

    What do you mean by justice? Justified?

  3. cgupta
    Member
    Posted 1 year ago #

    Thanks a lot Krishna!

    "Justice" is the name of the alignment in MS Word which i am referring to.
    Anyways i should try the text editor(Notepad).

  4. michael.mariart
    Member
    Posted 1 year ago #

    It's not a standard option in the visual editor... mainly because it is not a good idea to use that on a website thanks ot the varying width that happens pretty much everywhere.

    If you really have to do that though, go into the HTML view, and add this at the top:

    <div style='text-align: justify;'>

    And this at the bottom:

    </div>

    Taht will do what you want it to. Hopefully it looks the way that you want it to.

  5. cgupta
    Member
    Posted 1 year ago #

    Thanks Michael. i tried but the HTML editor doesn't recognize "Justice" as any margin alignment. will stick with what is available.!!

  6. michael.mariart
    Member
    Posted 1 year ago #

    It's NOT "justice" - It's "justify". See here for more examples.

    Type it exactly as I wrote it above and it will work.

  7. cgupta
    Member
    Posted 1 year ago #

    OOoppss sorry Michael..my bad..yes its Justify..i tried your exact lines but no positive results. is it working for you?

  8. michael.mariart
    Member
    Posted 1 year ago #

    Yes it does. Can you post a link to a page on your site that's got this problem? Then I can see what you've done there.

  9. cgupta
    Member
    Posted 1 year ago #

  10. michael.mariart
    Member
    Posted 1 year ago #

    OK, that's solved it. It's a very easy fix (when you look at the source code).

    All of your text in that article has the <p> tag set to align left, so that's over-riding the justify that you are using.

    Go back into the HTML editor, and change

    <p style="text-align: left;">

    to

    <p>

    on all of the paragraphs.

  11. cgupta
    Member
    Posted 1 year ago #

    Yes Michael,
    i just got it..i had to change it to <p style="text-align: justify;">. earlier i was just adding the <div style='text-align: justify;'> ahead of <p style="text-align: justify;"> which was the problem. Thanks a lot.

    but is there any way i can change the entire content to justify instead of changing each paragraph?

  12. michael.mariart
    Member
    Posted 1 year ago #

    Yes. Remove the style form all of your <p> tags.

  13. cgupta
    Member
    Posted 1 year ago #

    Thanks a Lot Michael....u made my day...

  14. cgupta
    Member
    Posted 1 year ago #

    the contents look good now...

  15. michael.mariart
    Member
    Posted 1 year ago #

    Glad that I could help.

    Just remember from nwo on that you should really do any cut-and-paste from Notepad, and not Word. Word just creates so many extra issues.

    Also, if you want this to be site-wide, you can ad da CSS rule to your stylesheet to enfoce it for every page/post that you make so you don't have to do this for everything.

  16. cgupta
    Member
    Posted 1 year ago #

    Roger that..can you walk me through the css rule steps? i am sorry i am new to these stuffs..

  17. michael.mariart
    Member
    Posted 1 year ago #

    To do it globally, you'd add this to the style.css file in your theme:

    `.entry-content p {
    text-align: justify;
    }`

    BUT, because you're using the default theme, I'd highly recommend creating a child theme so that your changes don't get over-written on the next update.

    This may be a bit beyond you and if it is, don't worry. It's a fair bit more involved then setting up a basic site, but if you can put in a bit of work, you'll soon learn all about how WordPress works behind the scenes.

  18. cgupta
    Member
    Posted 1 year ago #

    Awesome....now that you have given me solution and i have to be ON on WordPress, i should try to learn as far as i can...thanks!!

Topic Closed

This topic has been closed to new replies.

About this Topic