1 reply [Last post]
jjamjatra
Offline
newbie
Vienna Virginia USA
Last seen: 9 years 3 weeks ago
Vienna Virginia USA
Timezone: GMT-5
Joined: 2008-01-24
Posts: 9
Points: 3

I've been fiddling with this too long so asking for help getting the PayPal button and image centered on the page like the other elements. Here is a public version of the page I am testing:

http://tcb.cbmiweb.com/CSSbuttonTest2.htm

I have tried to get this centered in various ways. In this latest attempt I have posted, it made sense to me to try 3 table-cells with the intent of the middle one being centered (I put a dashed border in the dummy cells just to see during testing but I cannot understand why all 3 cells do not occupy the whole screen and hence are not centered.

The image(Drunk don't behave the same way as the text.

jjamjatra
Offline
newbie
Vienna Virginia USA
Last seen: 9 years 3 weeks ago
Vienna Virginia USA
Timezone: GMT-5
Joined: 2008-01-24
Posts: 9
Points: 3

Found a solution: /*Center

Found a solution:

/*Center the button in modern browsers*/
#paypal-button{
  display: block; 
  margin: 0 auto;
  width: 260px;
}		

I tried this earlier without an explicit width. Apparently, without width the margin auto does not work.