Results 1 to 3 of 3

Thread: About center alignment in Ie

  1. #1
    Join Date
    Feb 2008
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default About center alignment in Ie

    Hi guys

    i am having a problem with center alignment .
    it works fine in mozilla firefox but not in Ie?



    Code:
    Code:
    <html>
    <link rel="stylesheet" href="style.css">
    <body>
    <div id="container">
    
    	<div id="layout">
    	
    		<div id="header">
    		mike
    		</div>
    	
    	</div>
    	
    </div>
    </body>
    </html>
    Code:
    Code:
    
    *{
    margin:0;
    padding:0;
    }
    
    #container{
    width:100%;
    background-color:#dfd;
    height:100%;
    }
    
    
    #layout{
    width:800px;
    background-color:#fc9;
    margin:0px auto;
    }
    
    #header{
    width:800px;
    background-color:#ddd;
    height:150px;
    }

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Maybe this?:
    Code:
    *{
    margin:0;
    padding:0;
    }
    
    #container{
    width:100%;
    background-color:#dfd;
    height:100%;
    }
    
    
    #layout{
    width:800px;
    background-color:#fc9;
    margin:0px auto;
    }
    
    #header{
    width:800px;
    background-color:#ddd;
    height:150px;
    text-align: center;
    }
    Jeremy | jfein.net

  3. #3
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    IE version 6 and below has very very little support for CSS.
    try to apply the centering to the body element

    Code:
    body {
         margin: 0 auto;
         width: 760px;
         text-align: center;
         background: #(light_green_hexadecimal)
    }
    #container {
         text-align: left;
    }

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •