How can I align my form to the center of the background? CSS

Tags: css

Problem :

I have the following form:

with this CSS:

#myForm {
    margin: auto;
    width: 600px;
#myForm form {
    background-color: #E0E0E0;
    text-align: center;
    padding: 5px;
#myForm table {
    text-align: left;

here is a jsfiddle link:

How could I align the form table so that it is in the middle of the screen and the grey background? How would I also go about putting 1 line of space between the form and the submit/reset button?

Solution :

enter image description hereThe table will take up the specified width, and the remaining space will be split equally between the two margins

    margin: auto;
    width: 53%;
    border: 3px solid #73AD21;
    padding: 15px;

I'm also remove the size attrbut from th adress input

<input type="text" id="homeaddress" name="homeaddress"  />

I update your jsfiddle here

    CSS Howto..

    How is Facebook's website front-end and it's right sidebar designed?

    How to reduce my code in both jQuery and CSS

    How to keep button active after press with jQuery

    How do I align div vertically like in picture

    How to render email template in a page?

    How can I change the color of this text?

    How do I apply a css class to certain elements using jquery?

    How to apply CSS on texte label beside an input?

    how to go bottom of a website like back to top using javascript?

    How to center my images in my case?

    How to do a resizable link a:hover in CSS

    How does free hosting website work? [closed]

    How to center variable length submit buttons?

    How do I make my webpage scale-able depending on the size of the browser window?

    How to create a perspective shadow with CSS?

    How to tooltip keep active using HTML and CSS or Jquery?

    How to fit a list of images in an HTML div to form a 2D grid?

    jQuery — how to animate a div using height:auto

    How to set background gradient css via javascript [duplicate]

    How to edit mobile CSS in SocialEngine?

    Flexslider - How to make two slider functioning together (images and a paragraph text) using a single directionNav?

    CSS: How to set 100% width on the first li of ul

    How to set dynamic value in css? [closed]

    How can I customize the CSS generated by LESS to include Font Awesome?

    How to prevent adding CSS 'class' properties

    how to avoid the ID name in css file

    How JQuery can parse colors in text?

    how to avoid css jitters while applying css border with hover pseudo class

    How to get alternate colors div with pure css and with IE 7 support?

    How to stop divs moving in browser when zoom in/out?