Hack Forums
[Help] How would I go about centering my "contact us" form? - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Coders Lounge (https://hackforums.net/forumdisplay.php?fid=5)
+---- Thread: [Help] How would I go about centering my "contact us" form? (/showthread.php?tid=4410679)



How would I go about centering my "contact us" form? - Rarinator - Aug 23, 2014

Hey, I really want to know how the hell I can center my "contact us" form. I've tried a couple methods, but obviously not the right ones. Here's a picture of the form.

Spoiler (Click to View)

And here is the code for the form

Spoiler (Click to View)

Not knowing is bugging the hell out of me, thank you to anyone who attempts to help me.


* - Endatose - Aug 23, 2014

Not a expert on web development but
if you put the form in a class and in the css file do
margin-left: auto;
margin-right: auto
Try it and let me know if it works


* - Pixelblocker - Aug 23, 2014

You could try adding this to the CSS file:

Code
.box-white {
    position: absolute;
    left: 50%;
    margin-left: -half the width of your div;
}
e.g. width: 200px; margin-left: -100px;
That should work.


* - Knar. - Aug 23, 2014

Code
.contact-us {
    width: 800px;
    margin: 0 auto;
}