Page 1 of 1

I can't center a formBuilder form for my life!!

Posted: Thu Jan 06, 2011 7:26 pm
by fearmydesign
Hi everyone, I have been trying for 3 hours literally to center this stupid form... and it's not working of course!! please help.

I am calling the form with {FormBuilder form='sunlight-sms'} inside a content block
I have tried enclosing it on a div <div align="center">{FormBuilder form='sunlight-sms'}</div>
I have tried setting the margin right and left to auto on the css
I even places the <h2> tag inside the formBuilder form submission template

When I use this <div align="center">{FormBuilder form='sunlight-sms'}</div> it just centers the form but not the <h2> header that I have on the form template? why? if by centering this div it should center the whole form...

anyways, please help me, thank you!
Regards

Re: I can't center a formBuilder form for my life!!

Posted: Thu Jan 06, 2011 7:30 pm
by fearmydesign
...hmmmnnn

so I went back to the formBuilder template and changed the <h2> to a <div align="center"> and gave it font-size through the CSS and it works... but why was the <h2> giving me so many issues?

any feedback will help, thank you

Re: I can't center a formBuilder form for my life!!

Posted: Thu Jan 06, 2011 8:00 pm
by M@rtijn
H2 is aligned to the left by default. I'd would give that H2 a class and specify 'margin:0 auto;' for that class in your css.
(if you put the margin on the H2 itself all those headings on the website will be centered, not desirable in most situations)

The reason that 'align=center' might not work, is because it's depracted. It will work on some browsers maybe, but is not supported in general (http://www.w3schools.com/tags/tag_hn.asp)

Re: I can't center a formBuilder form for my life!!

Posted: Thu Jan 06, 2011 8:11 pm
by fearmydesign
The reason that 'align=center' might not work, is because it's depracted. It will work on some browsers maybe, but is not supported in general
Makes sense, thank you for your response.

Regards

Re: I can't center a formBuilder form for my life!!

Posted: Thu Jan 06, 2011 9:49 pm
by Dr.CSS
Nothing will center with margin: 0px auto if it doesn't have a width: XXpx declared as it can't figure out how much to move it by it's size, left to right...

Re: I can't center a formBuilder form for my life!!

Posted: Thu Jan 06, 2011 10:28 pm
by M@rtijn
What DrCSS said....

;D
Thanks for adding that information!