• hi all,

    my problem is, i want to center the form. i know that i can just add <center> to the whole thing, but then all elements of the form are centered. thats not exactly what i want…

    i want to center the whole form-block WITHOUT centering the included fields. like this: https://www.david-strohmayer.net/problem.png

    any ideas?

    thx

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter dstrohma

    (@dstrohma)

    no ideas?? please help :))

    Not sure but you could try using text indents”
    <html>
    <head>
    <style type=”text/css”>
    p {text-indent:50px}
    </style>
    </head>
    <body>
    text
    </body>
    </html>

    sorry – Didn’t work but does look kinda cool.

    I got this to work.

    add <div align="center"> </div> around the whole thing…

    and change:
    <p> </p>

    to:
    <p style="text-align: center"> </p>

    Works as seen on my site here:

    https://localhub.com/?page_id=22

    It even centered the wp-recaptcha plugin.

    Here is the code for my form:

    <div align="center">
    <p style="text-align: center">Your Name (required)<br />
        [text* your-name] </p>
    
    <p style="text-align: center">Your Email (required)<br />
        [email* your-email] </p>
    
    <p style="text-align: center">Subject<br />
        [text your-subject] </p>
    
    <p style="text-align: center">Your Message<br />
        [textarea your-message] </p>
    
    <p style="text-align: center">[recaptcha your-recaptcha]</p>
    
    <p style="text-align: center">[submit "Send"]</p>
    </div>

    Wrap the form with:

    <div style="margin: 0 auto;">
    your stuff here
    </div>

    If you need a set width, do (replacing 750 with whatever you want):

    <div style="margin: 0 auto; width:750px">
    your stuff here
    </div>
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: Contact Form 7] Center the whole form’ is closed to new replies.