Windows 10 reached EOS (end of support) on October 14, 2025. If you are on Windows 10, see this article.

Search Support

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
Lolu chungechunge lwabekwa kunqolobane. Uyacelwa ubuze umbuzo omusha uma udinga usizo.
Okugcinwe kunqolobane

How do you get HTML5 <nav> to center?

Dawn1

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/

Okulungisiwe ngu cor-el

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

margin-right:auto; }

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