Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

ابحث في الدعم

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

How do you get HTML5 <nav> to center?

  • 2 (ردّان اثنان)
  • 4 have this problem
  • 16 views
  • آخر ردّ كتبه Dawn1

more options

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)

more options

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/

Modified by cor-el

more options

nav { display:block; width:700px; margin-left:auto;

margin-right:auto; }

Yes! Adding display:block; centered it in Firefox. :)