1

I have nav menu of 9 items with top most structure like so:

UL LI A

I'm resetting text rendering:

#horizontalMega2 > li > a {
    font-family: "Helvetica", "Arial", "Verdana", "sans-serif";
    font-size:10px;
    font-weight: normal;
    letter-spacing: normal;
    white-space: nowrap;
    word-spacing: normal;
    text-transform: uppercase;
    width:100%;
}

When looping over them with jQuery:

$( '#horizontalMega2 > li').each( function(){
  console.log( 'outerWidth( true ) ' +  $(this).outerWidth( true ));
}

... consoles show in..

FF

outerWidth( true ) 61
outerWidth( true ) 59
outerWidth( true ) 39
outerWidth( true ) 50
outerWidth( true ) 19
outerWidth( true ) 27
outerWidth( true ) 114
outerWidth( true ) 68
outerWidth( true ) 78

Chrome

outerWidth( true ) 68
outerWidth( true ) 63
outerWidth( true ) 44
outerWidth( true ) 55
outerWidth( true ) 23
outerWidth( true ) 31
outerWidth( true ) 131
outerWidth( true ) 78
outerWidth( true ) 88

IE 10 9

 outerWidth( true ) 66 
 outerWidth( true ) 63 
 outerWidth( true ) 42 
 outerWidth( true ) 54 
 outerWidth( true ) 22 
 outerWidth( true ) 29 
 outerWidth( true ) 127 
 outerWidth( true ) 74 
 outerWidth( true ) 86

IE 8

 outerWidth( true ) 68 
 outerWidth( true ) 63 
 outerWidth( true ) 44 
 outerWidth( true ) 55 
 outerWidth( true ) 23 
 outerWidth( true ) 31 
 outerWidth( true ) 131 
 outerWidth( true ) 78 
 outerWidth( true ) 88

... interestingly enough IE8 and Chrome give the same results. Wham am I missing?

I'm using jQuery 1.9.1

halilb
  • 4,055
  • 1
  • 23
  • 31
vector
  • 7,334
  • 8
  • 52
  • 80
  • 2
    Have you used a [reset-stylesheet](http://stackoverflow.com/questions/tagged/css-reset) (to remove the browser-specific defaults for `margin`, `padding`, `letter-spacing` etc)? Have you tried setting `box-sizing: border-box` to the element(s) (and you'll possibly need to use vendor-prefixes)? – David Thomas Oct 26 '13 at 17:42
  • yes on padding and margin, no on box-sizing and border-box :-( – vector Oct 26 '13 at 18:16
  • tried, reset, no luck – vector Oct 26 '13 at 18:25
  • If you make a fiddle, does it still behave in the same way? – Mr Lister Oct 27 '13 at 15:57
  • I will, good idea. but it'll take a while. I'll post an update when done. – vector Oct 28 '13 at 01:22

0 Answers0