The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS IE8 and earlier doesn’t center section

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #34967

    I’m having a problem with centering a section within a div in Internet explorer 8. The section appears to the left border of the browser when testing it in IE but it centers in Firefox and Chrome. I’m using html5shiv so the use of section souldn’t be the problem. I’m using the html5 doctype and the code looks like this:


    and the css:

    section { width: 1000px; margin: auto; } 

    How would I solve this problem? Thanks


    Have you declared all HTML5 elements as block level elements somewhere in your stylesheet? If not just add display: block; and that should fix it.


    That did the trick. Thanks a lot, I’ll make a mental note of that.


    @WCMiller If you reread the post you will see that @Arvid is using the HTML5 shiv.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.