Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I googled this question and searched for an hour, every one specify their own likes, but i want to know the correct code to align the div in center position.

share|improve this question

closed as off topic by Scott, Vincent, JohnB, leugim, DA01 Mar 6 '13 at 17:28

Questions on Graphic Design Stack Exchange are expected to relate to graphic design within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

This question is better suited (and answered several times) on -> – Scott Mar 6 '13 at 14:12
As your research has shown, everyone has their own 'likes'--there is no one 'correct' way. – DA01 Mar 6 '13 at 17:28
up vote 2 down vote accepted

ok if you give your div an id of #centerdiv, the following css should center it

#centerdiv {  margin: 0 auto; }

be aware that you will have to give that div a width value as well

share|improve this answer
also this article may be of use here – MephistonX Mar 6 '13 at 16:00

Not the answer you're looking for? Browse other questions tagged or ask your own question.