Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    super newbie tring to center a generated paypal button

    Hey guys I've been struggling with this all day, goggling everything, and just can't seem to work it out.

    Below is a bit of code that displays a pay pal button for my site, but it aligns to the left. I want to center it if it is possible. I tired googling this and the responses where to put it in some DIV code, but what ever I tried didn't work.

    Can any of you smart people help me...


    Code:
    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_s-xclick">
    <input type="hidden" name="hosted_button_id" value="9GH3EVPWDVTWU">
    <input type="image" src="https://www.paypalobjects.com/en_AU/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal — The safer, easier way to pay online.">
    <img alt="" border="0" src="https://www.paypalobjects.com/en_AU/i/scr/pixel.gif" width="1" height="1">
    </form>

  • #2
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can use css

    example of css code:

    Code:
    .paypal1
    {
    position:absolute;
    right:0%;
    left:33%;
    width:150px;
    margin-top:15%;
    }
    this will make it go from the left side 33% and from the top 15% you can also use px (pixels) but i like %

    the code you use is
    Code:
    <html>
    <head>
    <link rel="stylesheet" href="paypal.css" type="text/css" />
    </head>
    <body>
    <div class="paypal1">
    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_s-xclick">
    <input type="hidden" name="hosted_button_id" value="9GH3EVPWDVTWU">
    <input type="image" src="https://www.paypalobjects.com/en_AU/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal — The safer, easier way to pay online.">
    <img alt="" border="0" src="https://www.paypalobjects.com/en_AU/i/scr/pixel.gif" width="1" height="1">
    </form>
    </div>
    </body>
    </html>
    the .paypal can be any word you want so you could have multiple css codes on one page
    The bits in red are the important bits you need on your html code, the bit in Blue is the css file its a text doc but saved as "whatevernameyouwant.css"
    Code:
    .paypal1
    {
    position:absolute;
    right:0%;
    left:33%;
    width:150px;
    margin-top:15%;
    }
    
    .test1
    {
    position:absolute;
    right:0%;
    left:33%;
    width:150px;
    margin-top:15%;
    }
    
    .test2
    {
    position:absolute;
    right:0%;
    left:33%;
    width:150px;
    margin-top:15%;
    }
    as long as the <div> has the desired name like <div class="test1"> your content </div>

    Code:
    <link rel="stylesheet" href="paypal.css" type="text/css" />
    the href="paypal.css" is the name of the css file

    hope this helps
    Last edited by ashstyx; 03-31-2012 at 11:58 AM.


  •  

    Posting Permissions

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