PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Make post body centered when entering

  1. yoramzara
    Member

    My site is avelim.co.il

    I am on Wordpress 3.5.1 in Hebrew with the theme Weaver II Pro 1.3.2

    I put a post submission form

    http://www.avelim.co.il/gravity-forms/

    When you enter text into the post body field it is aligned to the right. I want this changed. I need that any text entered will be centred by default.

    See
    http://goo.gl/ET8rS

    How do I do that?

    Posted 11 years ago on Monday March 18, 2013 | Permalink
  2. Centering only really makes sense for a one-line text input. But if you must have the text centered in the textarea, you can use JavaScript to achieve that. Please see this solution:

    http://codepen.io/desandro/pen/gICqd

    Posted 11 years ago on Tuesday March 19, 2013 | Permalink
  3. yoramzara
    Member

    Thanks for your response. I do need to center the whole post. I am not a coder. Could you please explain Where do I put the JavaScript? In the form somewhere?

    Posted 11 years ago on Tuesday March 19, 2013 | Permalink
  4. Do you want to center the text which is displayed on your site after the post is created (if your form is creating a post) or do you mean visually center the text in the textarea when it's being input?

    Posted 11 years ago on Tuesday March 19, 2013 | Permalink
  5. yoramzara
    Member

    Both. How do I achieve that?

    Posted 11 years ago on Wednesday March 20, 2013 | Permalink
  6. We're talking about two completely different things. I don't think it makes sense to the input area, but of you want to format the input like that, you will have to resort to using jQuery or JavaScript. This was the closest solution I found thus far, as I previously posted:
    http://www.gravityhelp.com/forums/topic/make-post-body-centered-when-entering#post-176242

    To center the text as it's displayed in your post, you will need to add some CSS to your theme's stylesheet. If you can share a URL to a post which is being created by your form, we can help you with the exact CSS. It will look something like this:

    [css]
    body #content .entry-content {
        text-align:center;
    }
    Posted 11 years ago on Saturday March 23, 2013 | Permalink