Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

How do you center menu with css regardless of user text size.?

I have a site at www.curetype2diabetes.info (in case it gets cut off that's .info). I've worked very hard to get it as accesible as possible but text size changes just kill me.

The worst part right now is my menu shifts when the text size changes. I have it centered when the text is medium size, but if it changes the menu shifts left or right.

How do I prevent this, I'd rather the text size still change but I want the menu to stay put.

2 Answers

Relevance
  • daa
    Lv 7
    1 decade ago
    Favorite Answer

    You have position: absolute; left: 9em; on the menu element, so it will always be fixed on the left. Try removing the positioning, and give it auto left & right margins:

    #topmenu {

    margin:1em auto 0 auto;

    text-align:center;

    word-spacing:1px;

    z-index:100;

    }

  • 1 decade ago

    use a "fluid" layout, so that the menu bars will still center when the text enlarges. That means using Percentages as your page layout width instead of a fix pixel width

Still have questions? Get your answers by asking now.