How do you get HTML5 <nav> to center?
nav { width:700px; margin-left:auto; margin-right:auto; } /* This centering only works in Google Chrome */
nav { width:700px; margin-left:auto; margin-right:auto; }
/* This centering only works in Google Chrome */
All Replies (2)
Is <nav> a block or an inline element?
See http://31o5.com/2010/04/18/wordpress-theme-in-html5/
Try nav { width:700px; text-align: center; }
See also http://dorward.me.uk/www/centre/
Gewysig op
nav { display:block; width:700px; margin-left:auto;
margin-right:auto; }
Yes! Adding display:block; centered it in Firefox. :)