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!

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

How do you get HTML5 <nav> to center?

  • 2 回覆
  • 4 有這個問題
  • 16 次檢視
  • 最近回覆由 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 */

所有回覆 (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/

由 cor-el 於 修改

more options

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

margin-right:auto; }

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