Centering <div> tags

What's the easiest way to center a <div> tag horizontally? Btw, the width is set to 80%, not a set pixel width.
In a separate <div> tag, how would I center it vertically?
I'm surprised you can't just use float:center to center it horizontally.
In a separate <div> tag, how would I center it vertically?
I'm surprised you can't just use float:center to center it horizontally.
0
Comments
Vertically I'm less sure, but margin-top:auto and margin-bottom:auto would be worth a try.
This is the method I typically use. Requires you to have a fixed width defined on the div though, so don't forget that. Shorthand for this is margin: 0 auto;
This doesn't work of course when the width is 80%.... you might need to use absolute positioning. Is the parent container a fixed width and height?