Center a div
This is an extremely common question that is sometimes answered incorrectly. Some will say to set at least two DIVs with the left-most DIV at a width of 50% and the right-most DIV with a negative margin that equals half of the right-most DIVs width. Though this does work, it is wrong.
Anyway, here’s the correct css code for a div with an id of ‘wrapper’.
-
-
#wrapper {
-
margin-right:auto;
-
margin-left:auto;
-
}
-
Enjoy.