Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9076981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:13:54+00:00 2026-06-16T19:13:54+00:00

I have a strange problem on a navigation menu that only appears in Firefox

  • 0

I have a strange problem on a navigation menu that only appears in Firefox (works fine in IE7, 8, 9, 10 & Chrome). The links on the menu are displayed as blocks however they are calculated larger in Firefox (more width) than any other browser and so they don’t align properly. The odd thing is that once the links have been clicked even if it’s a right click then Firefox puts them to how they should be.

The CSS has been reset and this problem on happens in Firefox so I’m thinking it is a Firefox bug?

<nav>
    <ul id="primary-nav">

        <li><a id="nav-home" href="/wordpress">HOME</a></li>
        <li><a id="nav-work" href="/wordpress/work">WORK</a></li>
        <li><a id="nav-about" href="/wordpress/about">ABOUT</a></li>
        <li><a id="nav-contact" href="/wordpress/contact">CONTACT</a></li>
        <li><a id="nav-blog" href="">BLOG</a></li>

    </ul>
</nav>


ul#primary-nav li {
    float: left;
    list-style-type: none;
    background: none;
    padding: 0;
    margin-left: 25px;
}

ul#primary-nav li a {
    font-size: 1.5em;
    display: block;
    padding-top: 40px;
}

ul#primary-nav li a#nav-home {
    background: url('./images/nav-home-button.png') top center no-repeat;
}

ul#primary-nav li a#nav-work {
    background: url('./images/nav-work-button.png') top center no-repeat;
}

ul#primary-nav li a#nav-about {
    background: url('./images/nav-about-button.png') top center no-repeat;
}

ul#primary-nav li a#nav-contact {
    background: url('./images/nav-contact-button.png') top center no-repeat;
}

ul#primary-nav li a#nav-blog {
    background: url('./images/nav-blog-button.png') top center no-repeat;
}

ul#primary-nav li a:first-letter {
    font-size: 1.3em;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T19:13:55+00:00Added an answer on June 16, 2026 at 7:13 pm

    conclusion: there is a bug in firefox that miscalculates the width of an element if its :first-letter has a font-size set.

    This bug has been filled in 2007: https://bugzilla.mozilla.org/show_bug.cgi?id=385615 . As of January 2013, it is still open. Linking to this answer from there.

    In fact, there is already a Stack Overflow question from September 2011 asking for a work-around.

    The accepted work-around is to trigger a reflow by performing an animation (credit: kizu)

    @-moz-keyframes bugfix { from { padding-right: 1px ; } to { padding-right: 0; } }
    
    .test {-moz-animation: bugfix 0.001s;}
    


    Here is the minimal test case that demonstrates the issue (http://jsfiddle.net/6eYu6/1/):

    <div><a href="#">HOME</a></div>
    <div><a href="#">WORK</a></div>
    
    div{float: left;}
    a{display: block;}
    a:first-letter {font-size: 1.3em;}​
    

    In Chrome, there’s no gap (expected behavior). In Firefox, there is a gap due to the a element being wider.


    My research:

    On clicking the first link, or tabbing to it, the gap disappears. The gap does not reappear when the link loses focus. The link reappears on page reload.

    If the href attribute is removed (http://jsfiddle.net/6eYu6/2/), the gap persists. Clicking no longer has any effect.

    Adding a click handler or preventing the click action (return false in jQuery) has no effect in either direction. The same applies to the focus event (it is triggered with href present). Preventing the focus event removes the effect of tabbing onto the link.


    Removing the float attribute and turning all elements inline causes predictable behavior (a whitespace-sized gap, no effect on clicking). However, the effect of :first-letter disappears as well.

    When the font-size is removed, or given to the whole link, or given to a span, the gap disappears.

    The width of the link (in firefox, before the click-fix) is the same as if the entire text had that font size.

    When a hover effect that involves resizing the element is added to the link, the gap disappears on first hover.

    When the float is removed, the link width is 100% (naturally).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have strange problem with run .exe program in my WebApplication. It works fine
I have a strange problem getting the color of the point that was touched.
I have a very strange problem with a UITableview within a navigation controller on
i have strange problem , my application (exe) is working fine in debug mode
I have a strange problem with a memory leak (the only one ;-) )
I have a strange issue with my css navigation menu. The code is here:
I have a strange problem when deleteting records using linq, my suspicion is that
I have a strange problem, in my settings file everything is enabled that needs
Got a strange problem. The cancel button that normally is shown at the navigation
So I'm having this strange problem. I have a ribbon moving behind the navigation

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.