Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Jun 2008
    Location
    West midlands, Birmingham.
    Posts
    2,093
    Tokens
    219

    Latest Awards:

    Default Why does internet explorer do this?

    Hey

    I've coded a layout and in every browser apart from internet explorer is centered, in IE it is on the left.

    Does anyone know how to solve this?

    Heres my CSS:
    Code:
    body {
    
    	font: 10px verdana;
    
    	color: #666666;
    
    	margin:0px auto 0 auto;
    
    }
    
    
    
    a {	font: 10px verdana; }
    
    a:link    { text-decoration: none;  color: #666666; }
    
    a:visited { text-decoration: none;  color: #666666; }
    
    a:hover   { text-decoration: none; color: #666666; }
    
    a:active  { text-decoration: none;  color: #666666; }
    
    
    body {
    	background-image: url(images/bg.png);
    }
    
    
    /* LAYOUT */
    #wrapper {
    	width: 900px;
    	margin-top: 20px;
    	margin-left: auto;
    	margin-right: auto;
    }
    
    #notice {
    	background: url('images/notice.png') no-repeat;
    	width: 900px;
    	height: 79px;
    	padding-top: 0px;
    	padding-left: 50px;
            text-align: center;
    }
    
    #banner {
    	background: url('images/banner.png') no-repeat;
    	width: 900px;
    	height: 136px;
    }
    
    #nav {
    	background: url('images/nav.png') no-repeat;
    	width: 900px;
    	height: 40px;
    	padding-top: 0px;
    	padding-left: 7px;
            text-align: center;
    }
    
    #content_bg {
    	background: url('images/contentbg.png') repeat-y;
    	width: 900px;
    }
    
    #left {
    	width: 302px;
    	float: left;
    	margin-left: 0px;
    }
    
    #right { 
    	width: 579px;
    	float: left;
            margin-left: 10px;
    }
    
    #newsimg {
    	background: url('images/newsimg.png') repeat-y;
    	width: 302px;
    	height: 188px;
    }
    
    #bluebox {
    	background: url('images/bluebox.png') no-repeat;
    	width: 302px;
    	height: 42px;
    	padding-top: 7px;
    	padding-left: 9px;
    }
    
    #greenbox {
    	background: url('images/greenbox.png') no-repeat;
    	width: 302px;
    	height: 44px;
    	padding-top: 7px;
    	padding-left: 9px;
    }
    
    #footer {
    	background: url('images/footer.png') no-repeat;
    	width: 900px;
    	height: 7px;
    	clear: both;
    }
    
    #copyright {
    	width: 900px;
    	margin-left: auto;
    	margin-right: auto;
    	margin-bottom: 25px;
    	color: #FFF;
    }
    +rep for all helpers.

    Thanks in advanced

  2. #2
    Join Date
    Apr 2008
    Location
    Derby
    Posts
    4,668
    Tokens
    262

    Latest Awards:

    Default

    I may be wrong but I dont think you need to have margin-left:auto; and margin-right:auto; you can just have one, [In the wrapper im guessing?].. MAY BE WRONG THOUGH.
    Lol, Im a CSS noob but... it may help.

  3. #3
    Join Date
    Apr 2009
    Location
    United Kingdom
    Posts
    1,111
    Tokens
    100

    Latest Awards:

    Default

    Which Internet Explorer version Jack?

  4. #4
    Join Date
    Jun 2008
    Location
    West midlands, Birmingham.
    Posts
    2,093
    Tokens
    219

    Latest Awards:

    Default

    Quote Originally Posted by iApps View Post
    I may be wrong but I dont think you need to have margin-left:auto; and margin-right:auto; you can just have one, [In the wrapper im guessing?].. MAY BE WRONG THOUGH.
    Lol, Im a CSS noob but... it may help.
    i will try thanks
    Quote Originally Posted by BoyBetterKnow View Post
    Which Internet Explorer version Jack?
    All i think :L

    EDIT; It didn't work ;[
    Last edited by iDenning; 13-08-2009 at 06:10 PM.

  5. #5
    Join Date
    Apr 2008
    Location
    Derby
    Posts
    4,668
    Tokens
    262

    Latest Awards:

    Default

    Omnomnomon sorry!
    No idea then, Soz

  6. #6
    Join Date
    Jun 2008
    Location
    West midlands, Birmingham.
    Posts
    2,093
    Tokens
    219

    Latest Awards:

    Default

    Quote Originally Posted by iApps View Post
    Omnomnomon sorry!
    No idea then, Soz
    Lol no problem

    Why does IE have to be different to every other browser ;l

  7. #7
    Join Date
    Aug 2009
    Posts
    20
    Tokens
    0

    Default

    Hey,
    I hope this helps solve your problem..

    In the CSS use:
    Code:
     
    body {
    Margin: 0px auto;
    Padding: 0px;
    Text-align: center;
    }
    
    #main {
    Width: 770px;
    Height: 100%;
    Margin: 0px auto;
    Text-align: left;
    Padding: 5px;
    }
    Now with that CSS, create a Div and give it an ID 'main'. Inside this div everything else should go, such as, other divs or content.. the 'main' div should now be centered keeping a width of 770px with the padding gives us 780px, which is a nice width for users with 800 x 600 screen resolutions. Meaning there will be 10px each side of the 'main' div for that size screen resolution.

    Hope this helps.

    Best of luck,

    Alan.

  8. #8
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    <div align="center">contenthere</div>

    ..

  9. #9
    Join Date
    Apr 2005
    Location
    South Wales!
    Posts
    3,535
    Tokens
    2,836

    Latest Awards:

    Default

    Cant you make a separate ie stylesheet? so if you fix it for IE you can make sure it doesnt mess up for any other browsers because of the fix.

    Would be what I would be anyway saves loads of hassle.

  10. #10
    Join Date
    Jun 2008
    Location
    West midlands, Birmingham.
    Posts
    2,093
    Tokens
    219

    Latest Awards:


Page 1 of 2 12 LastLast

Posting Permissions

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