Skip to content Skip to sidebar Skip to footer

Center A Div That Contains A Contact Form

How do I center a contact form which is inside a div. I have tried margin:0 auto; and it didn't work.

Solution 1:

In order to get margin: 0 auto; work you need to set width.

#new_div_3 {
    width: 500px;
    margin: 0 auto;
}

Check the fiddle: http://jsfiddle.net/9cMAC/


Solution 2:

#new_div_3 {
    width:100%;
    display:block;
    margin:auto;
}

Should be all you need.


Solution 3:

Here you go:

#new_div_3 {
margin: 0 auto;
position: relative;
width: 60%;

}

check fiddle


Post a Comment for "Center A Div That Contains A Contact Form"