0

I'm just starting out with trying to build a website and I'm having a bit of trouble editing an already existing CSS file. I have it so that in chrome the menu is centred but in internet explorer it is left aligned - I want it always central.

The website is http://rkalbanart.co.uk/

Is there a quick fix for this? I've tried googling but with my simpletons knowledge everything goes quite far over my head!

Alex Martin
  • 83
  • 1
  • 5

4 Answers4

1

You are using display: table; to align this menu, that property doesn't work on Internet Explorer 7 http://caniuse.com/css-table

So you should not support IE7 or change the way you do your menu to my example bellow

CSS:

#main-menu-center-border:before,
#main-menu-center-border:after {
    content: " "; /* clearfix hack */
    display: table; /* clearfix hack */ 
}
#main-menu-center-border:after {
    clear: both; /* clearfix hack */
}
#main-menu-center-border {
    *zoom: 1; /* clearfix hack for IE6/IE7 */
}
#main-menu-center-border {
    max-width: 426px;
    display: block; /* instead of display: table */
}
Vinícius Moraes
  • 3,506
  • 2
  • 22
  • 24
0

Don't apply display: table to .main-nav, it is not supported in IE7.

See more at this question

Community
  • 1
  • 1
jasonslyvia
  • 2,529
  • 1
  • 24
  • 33
0

You can keep the display:table on it if you want to retain the vertical alignment, but for IE7 you'll need to apply a width to the div id="main-menu-center-border" otherwise it'll assume a 100% width, which won't centre.

#main-menu-center-border { max-width:430px; }

Edit: changed to max-width to support responsive styling. Alternatively use a IE7 only style using width:430px.

Wayne Austin
  • 2,979
  • 3
  • 25
  • 30
-3

I think you are using old version of explorer. So you need to use newer version of explorer called version 10. It looks same in chrome and explorer 10. Just check in explorer 10. It works perfectly in version 10.

  • Dude, not everyone is on 10, my company for instance (unfortunately) can't upgrade past IE8 until we upgrade our systems. It's not just one person that you code for. – Jacques ジャック Sep 11 '13 at 14:00
  • "Then i think your company using pirated version of windows" ... are you serious?! – Wayne Austin Sep 11 '13 at 14:05
  • Really? I didn't say windows was the issue, I said upgrade our systems. We use a system that will not allow us to go above a certain version of Java, and uses oracle at a specific version. The fact is, that in the real world, companies cant afford to upgrade every year. – Jacques ジャック Sep 11 '13 at 14:23