SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Coding for Jesus LavernGingerich's Avatar
    Join Date
    Jul 2003
    Location
    Tennessee
    Posts
    607
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Centering a <form>

    I would like to center my Paypal donate button, but it always left justifies even when I enclose the form in <p align="center"> </p>.

    How do you do it?

    Thanks!
    Yoder's Smoky Mountain Barbecue
    High quality barbeque smokers, pig roasters, and bbq pit grills.
    Pursuing Life Ministries - Jesus has saved me and given me hope.

  2. #2
    SitePoint Addict
    Join Date
    Jun 2004
    Location
    UK, London
    Posts
    312
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A url would help. You can center almost anything by giving it a width and an auto margin in your CSS though:

    form{
    width:20em;
    margin: 0 auto;
    }
    Chris Heilmann
    Blog | Articles | Binaries

  3. #3
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can't have a FORM inside a P, and since the </p> end-tag is optional, the <form> start-tag will implicitly close the paragraph. Thus your deprecated ALIGN attribute has no effect.

    Since INPUT elements are inline, you should be able to centre the button by setting text-align:center on the appropriate container (e.g. the form itself, a FIELDSET or a DIV within the form).
    Birnam wood is come to Dunsinane


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •