There's a bit more than that.
You have to pre-define the width on your body for your element (nav in this case) to actually adopt a margin.
make sure you have these before you apply the margin
html {
width: 100%;
}
body {
width: 1200px; /* change this to whatever width you are working with */
margin: 0 auto;
}
If you don't do this, your margin:0 auto on your nav will center it to the left giving the appearance that it didn't work.
EDIT
You have to spend some time creating some basic htmls and learn the fundamentals of website architecture. I appreciate your passion, I was the same way when I started years ago when HTML was simpler, but trust me man, web development has gotten a lot of muscle over the last 10 years. Start from the bottom as move up as you start dominating the concepts.
Here is the JSFiddle for your working solution.