This site will have limited functionality while we undergo maintenance to improve your experience. If an article doesn't solve your issue and you want to ask a question, we have our support community waiting to help you at @FirefoxSupport on Twitter and/r/firefox on Reddit.

Etsi tuesta

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.

Lue lisää

How do you get HTML5 <nav> to center?

  • 2 vastausta
  • 4 henkilöllä on sama ongelma
  • 16 näyttöä
  • Viimeisin kirjoittaja 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 */

Kaikki vastaukset (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/

Muokattu , muokkaaja cor-el

more options

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

margin-right:auto; }

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