SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Dec 2005
    Location
    Calgary, AB
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with CSS displaying correctly in IE .

    I just recently launched my personal web site. After creating the mock-up in photoshop then hardcodeing in dreamweaver I had the site exactly how I want it to appear, however it only appears this way in Firefox. Now unfortinatly there are to many people still using IE to ignor this problem.

    It seams to be the margin-left:auto; and margin-right:auto;
    The divs floats in the center, however when viewed with IE it breaks and aligns to the left.

    I'v be trying to fix this problem for awhile now, and if anyone can help me out it would be much apprieciated !!!!
    My site can be viewed here: http://www.jeffrendek.com

    Thanks
    -JEFF

  2. #2
    SitePoint Wizard bronze trophy Tyssen's Avatar
    Join Date
    Oct 2005
    Location
    Brisbane, QLD
    Posts
    4,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you talking about your whole layout not being centred? Are you using IE5?

  3. #3
    SitePoint Member
    Join Date
    Dec 2005
    Location
    Calgary, AB
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah the whole layout isnt centered, I'm viewing it with IE 6.0.
    It's centered on the main index page and the contact page, but if you navigate through the rest of the site it changes and aligns to the left. The same code has been applied on all the pages so i'm stumped on why it's happening??

    I also noticed the display:block; did not remove my bullets on the main index page

  4. #4
    SitePoint Wizard silver trophybronze trophy Nadia P's Avatar
    Join Date
    Oct 2004
    Location
    NSW Australia
    Posts
    3,564
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
     <head>
     <title>whatever</title>
     <style type="text/css">
     <!--
     body { 
    text-align:center;
    }
     #wrapper {
    text-align:left; 
    width:720px; 
    margin:0  auto;
    position:relative; 
    }
     -->
     </style>
     </head>
     <body> 
    <div id="wrapper">
     <!-- The rest of the page -->
     </div>
      <!-- /wrapper -->
     </body>
     </html>
    I see your layout centered in FF and IE6.
    The simple example above will ensure a centered layout in IE5.5 (which is showing your layout left aligned at the moment - so I'm presuming are you talking about a less version of IE6).

    You need to center the body and then wrap everything else in a wrapper div and counter the centeRING by using text-align: left on the wrapper div (otherwise all your content in the other divs will all be centered).

    Hope this helps.

    Nadia


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
  •