Skip to main content
Inspiring
March 22, 2022
Question

How to Center Menu Items?

  • March 22, 2022
  • 1 reply
  • 535 views

In my navigation bar, items appear centered on my desktop computer, but on a laptop or tablet, they are not.

How can I center them?

www.winvoices.com

    This topic has been closed for replies.

    1 reply

    Nancy OShea
    Community Expert
    March 22, 2022

    Given the age of your code, I think it looks fine. 

     

     

    But you do have fatal code errors.

    https://validator.w3.org/nu/?doc=https%3A%2F%2Fwinvoices.com%2F

     

    There is a stray e on your first line of code, before the document type.  You can ditch all the conditional junk, too. 

     

    e<!doctype html>
    <!-- saved from url=(0022)http://internet.e-mail -->
    <!--[if lt IE 7]> <html class="ie6 oldie"> <![endif]-->
    <!--[if IE 7]>    <html class="ie7 oldie"> <![endif]-->
    <!--[if IE 8]>    <html class="ie8 oldie"> <![endif]-->
    <!--[if gt IE 8]><!-->
    <html class="">
    <!--<![endif]-->
    <head>

     

    Replace it with this:

    <!doctype html>
    <html lang="en">
    <head>

     

    Nancy O'Shea— Product User & Community Expert
    Inspiring
    March 22, 2022

    Your image is how it appears on a smartphone. This is how it appears on a tablet.

     

    Inspiring
    March 22, 2022

    Right, there's not enough real estate for a menu that size on all devices.  Something has to give. Learn to live with it.  Or make the menu collapsed on ALL devices.  Fixing the fatal code errors is a greater priority, IMO.

     


    I made the changes you suggested and thanks so much for that!