6 replies [Last post]
chiba
chiba's picture
Offline
newbie
Last seen: 6 years 51 weeks ago
Timezone: GMT+1
Joined: 2013-08-10
Posts: 3
Points: 4

The site displays as it should in IE10 & 9 but in 7 and 8 the menu is shifted to the left for some reason. The margin-left:auto and margin-right:auto do not seem to work or something is over-riding them, any ideas?

IE10
IE10.JPG

IE7
IE7.JPG

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 1 day 20 min ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

Have a look in the how to

Have a look in the how to section there is a post about centering.
Older IE versions need to use text-align:center; on the container.
If your site is in quirks mode or not in standards mode, then IE treats it like IE6.

chiba
chiba's picture
Offline
newbie
Last seen: 6 years 51 weeks ago
Timezone: GMT+1
Joined: 2013-08-10
Posts: 3
Points: 4

There seems to be something

There seems to be something strange going on with my span tag "menu"

You can see the blue outline below.

ie7 mode - width of span is longer than content
ie7.JPG

ie8 and above - width is the size of the content, but height is bigger
ie8.JPG

Chrome has the same issue, the height is bigger than content
chrome.JPG

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 1 day 20 min ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

Are you using something to

Are you using something to help IE7 and 8 understand HTML5 new elements?

chiba
chiba's picture
Offline
newbie
Last seen: 6 years 51 weeks ago
Timezone: GMT+1
Joined: 2013-08-10
Posts: 3
Points: 4

Yes I am <!--[if lt IE

Yes I am

<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<![endif]-->
<!-- Style sheet for PC computers -->

// JavaScript Document
/**
 * IE hacks for HTML5 tags
 *
 * @package WordPress
 * @subpackage Constructor
 *
 * @author   Anton Shevchuk <[email protected]>
 * @link     <a href="http://anton.shevchuk.name" rel="nofollow">http://anton.shevchuk.name</a>
 */
function html5forIE(){
    var html5elmeents = "address|article|aside|audio|canvas|command|datalist|details|dialog|figure|figcaption|footer|header|hgroup|keygen|mark|meter|menu|nav|progress|ruby|section|time|video".split('|');
    for(var i = 0; i < html5elmeents.length; i++){
        document.createElement(html5elmeents[i]);
    }
}
html5forIE();

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 7 hours 15 sec ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9761
Points: 3843

IE9

feed the shiv script to IE<10. IE9 is not supportive of html5.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

bestgamenews01
bestgamenews01's picture
Offline
newbie
Last seen: 6 years 42 weeks ago
Timezone: GMT+8
Joined: 2013-10-18
Posts: 1
Points: 1

RS Gold

You can talk with friends, brainstorming on the other hand, you can also check the Internet so the answer a little more authority. I think these are a good way to solve the problem. Good luck to you!

link removed