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

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
User avatar
fearmydesign
Power Poster
Power Poster
Posts: 363
Joined: Sun Feb 28, 2010 10:54 pm

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

Post 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
User avatar
fearmydesign
Power Poster
Power Poster
Posts: 363
Joined: Sun Feb 28, 2010 10:54 pm

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

Post 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
User avatar
M@rtijn
Power Poster
Power Poster
Posts: 706
Joined: Sat Nov 14, 2009 4:54 pm

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

Post 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)
Make your community a better place!
User avatar
fearmydesign
Power Poster
Power Poster
Posts: 363
Joined: Sun Feb 28, 2010 10:54 pm

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

Post 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
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

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

Post 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...
User avatar
M@rtijn
Power Poster
Power Poster
Posts: 706
Joined: Sat Nov 14, 2009 4:54 pm

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

Post by M@rtijn »

What DrCSS said....

;D
Thanks for adding that information!
Make your community a better place!
Post Reply

Return to “Layout and Design (CSS & HTML)”