center a div

  • tastysite
  • Proficient
  • Proficient
  • User avatar
  • Posts: 349
  • Loc: Brighouse, West Yorkshire, England

Post 3+ Months Ago

Hi im using this css
Code: [ Select ]
 
#wrapper {
    display:block;
    position:relative;
    width:900px;
    height:100%;
    margin:0px auto;
    }
  1.  
  2. #wrapper {
  3.     display:block;
  4.     position:relative;
  5.     width:900px;
  6.     height:100%;
  7.     margin:0px auto;
  8.     }


It works fine in firefox and crome but crashers in IE it ingores my margin:0px auto; code and floats it left! Why is this :?:
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6252
  • Loc: Seattle, WA

Post 3+ Months Ago

Code: [ Select ]
body {
margin: 0 auto;
}

div#wrapper {
width: 900px;
}
  1. body {
  2. margin: 0 auto;
  3. }
  4. div#wrapper {
  5. width: 900px;
  6. }

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 28 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.