SitePoint Sponsor

User Tag List

Results 1 to 19 of 19

Thread: No center in IE

  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2006
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    No center in IE

    Hi guys,

    can I get a fresh pair of eyes to look over this for me, please.

    The site wrapper centers fine in Opera, FF, Chrome and Safari and validates to strict, but for some reason, in all versions of IE, even 8 the wrapper floats to the left of the screen.

    I've been through it line by line and am quickly losing my temper with it.

    Any ideas, post 'em up.

    Cheers.

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2006
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just to add, if I remove the doctype from the include file it resides in and embed it directly into the page, it works.

    I can't see any extra characters before the doctype, I'm confused as all hell.


  3. #3
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,564
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    Gah it doesn't show in here...but there is a [] (not the brackets, but a weird character).

    Something is before the DTD.

    Edit: It doesn't haveto be characters, spaces, lines, anything will put IE into quirks mode.
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work

  4. #4
    SitePoint Enthusiast
    Join Date
    Apr 2006
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Using the W3C Validator suggests the same but there's no extra characters, spaces or anything that I can see. The doctype is just a direct copy from sites I've created before; without this problem.

    It's really, really odd.

  5. #5
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,564
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    If you view source (with IE7 which is what I'm using) there is a character before the DTD. Post the include.php where you include the file ANDD post the page PHP where you include the DTD. Start from the top...
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work

  6. #6
    SitePoint Enthusiast
    Join Date
    Apr 2006
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The meta file include:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    
    <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    
    <meta name="keywords" content="Coordinate Measuring Machines, aberlink CMM metrology, precision measurement, Aberlink Axiom CMM, Aberlink Zenith CMM, Aberlink Project X CMM, Aberlink Extreme CMM" />
    <meta name="description" content="Aberlink Ltd are world leaders in the manufacture of precision metrology Coordinate Measuring Machines (cmm) and software." />
    <meta name="verify-v1" content="0RvSK3ZBsIl/tAny0snrpetnQDFKrycJSEDGkAaMk4o=" />
    <meta name="distribution" content="Global" />
    <meta name="copyright" content="Copyright Aberlink Ltd 2009. All rights reserved." />
    <meta name="resource-type" content="document" />
    <meta name="author" content="Tom Bryan" />
    <meta name="robots" content="index,follow" />
    <meta name="content-language" content="english" />
    <meta name="rating" content="General" />
    <meta name="revisit" content="28 days" />
    
    <link href="css/styles.css" rel="stylesheet" type="text/css" media="screen" />
    <link href="css/slimbox2.css" rel="stylesheet" type="text/css" media="screen" />
    <link href="contact/dd-formmailer.css" rel="stylesheet" type="text/css" media="screen" />
    <link href="http://www.aberlink.co.uk/feed.xml" rel="alternate" title="Aberlink RSS"  type="application/rss+xml" />
    <link href="images/favicon.png" rel="shortcut icon" /> 
    
    <script type="text/javascript" src="js/jquery-1.3.1.min.js"></script>
    <script type="text/javascript" src="js/slimbox2.js"></script>
    
    <!--[if IE 6]>
    <script type="text/javascript" src="js/DD_belatedPNG_0.0.7a-min.js"></script>
    <script type="text/javascript">DD_belatedPNG.fix('#highlight, #highlightB, .call, .cc, .email, .rss img');</script>
    <![endif]-->

    Main page:

    Code:
    <?php include ('include/meta.php'); ?>
    
    <title>Aberlink Ltd Innovative Metrology - Coordinate Measuring Machine and Software Manufacturer</title>
    
    <?php include ('include/nav.php'); ?>
    
    
    
    <div class="indexCol">
    <h1 class="headerInline">LATEST</h1><h2 class="headerInline">NEWS</h2>
    
    <p class="clearthis">Aberlink Official HQ Opening.
    <a href="news.php"> Read more.</a></p>
    
    <p>Aberlink launches the new Zenith Too range of machines.
    <a href="news.php">Read more.</a></p>
    </div>
    
    
    <div class="indexCol">
    <h1 class="headerInline">SOFTWARE</h1><h2 class="headerInline">VERSION</h2>
    
    <p class="clearthis">Current Aberlink 3D version: 30.22.9 | Released: 22/01/09
    <a href="downloads.php">Download now.</a></p>
    
    <p>Current Aberlink CAD Module: Jan 2008 Rel
    <a href="downloads.php">Download now.</a></p>
    </div>
    
    
    <div class="indexCol">
    <h1 class="headerInline">NEW</h1><h2 class="headerInline">PRODUCTS</h2>
    
    </div>
    
    <?php include ('include/footer.php'); ?>

  7. #7
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,564
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Ok View Source of your page. Notice how there is a [] right before the DTD. I'd manually paste that DTD in.
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work

  8. #8
    SitePoint Enthusiast
    Join Date
    Apr 2006
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I see what you mean about the space in IE7, Weird as hell, seriously.

  9. #9
    SitePoint Enthusiast
    Join Date
    Apr 2006
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, so here it is. I usually code in Notepad++, so I copied the code cranked up Dreamweaver and dropped it into a new page. Then overwrote the meta.php.

    ...it works! If anyone would care to explain to me this unexplainable problem, feel free.

    Thanks for your help though, Ryan. Cheers man.

    And sorry, this should've gone in the xhtml forum.

  10. #10
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,564
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Yea I'd have to manually go into your cpanel/file to really see waht the problem is. Probably didn't show up when you copied pasted the file in since it won't let you copy in those characters here. Look very carefully/if you feel safe enough I'll manually go in. I'd recommend the first one first .

    Edit: No problem.
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work

  11. #11
    Design Your Site Team bronze trophy Erik J's Avatar
    Join Date
    May 2007
    Location
    Countryside, Sweden
    Posts
    3,407
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Genjutsushi View Post

    ...it works! If anyone would care to explain to me this unexplainable problem, feel free.

    And sorry, this should've gone in the xhtml forum.
    The odd letters before the doctype was probably an UTF-8 BOM mark (Byte Order Mark) your editor had put in when saving the document. Check saving options in your editor. (E.g. Windows Notepad mandatory saves utf-8 with a bom mark, with W. Notepad save in ansi instead.)

    I'll ask an advisor to move the thread for you.
    Happy ADD/ADHD with Asperger's

  12. #12
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,251
    Mentioned
    113 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by erik.j View Post
    I'll ask an advisor to move the thread for you.
    And done...
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style

  13. #13
    SitePoint Enthusiast
    Join Date
    Apr 2006
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by erik.j View Post
    The odd letters before the doctype was probably an UTF-8 BOM mark (Byte Order Mark) your editor had put in when saving the document. Check saving options in your editor. (E.g. Windows Notepad mandatory saves utf-8 with a bom mark, with W. Notepad save in ansi instead.)

    I'll ask an advisor to move the thread for you.
    Nail -- > Head.

    Notepad++ was saving UTF-8 BOM. A little strange how it hadn't effected any sites I've done before this one.



    ++ Edit just checked my laptop which I usually code on and the encoding type was set to ANSI, that fully explains it.



    Still, thanks very much for clearing that up, I'll know in future.

  14. #14
    SitePoint Wizard bronze trophy Centauri's Avatar
    Join Date
    May 2007
    Location
    Newcastle, Australia
    Posts
    3,718
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    On another note, I notice that your meta file include does not actually contain any php commands, so why does it have a .php file extension? - this just makes the php parser do more work than it needs to.

  15. #15
    SitePoint Enthusiast
    Join Date
    Apr 2006
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's just the way I've always worked, regardless of content. It's like a template that I work to.

    I can't see that it makes a really noticeable amount of difference when it comes to parsing. Tell me if I'm wrong and I'll take stock of my routine. I'm always open to suggestions and appreciate the input.

  16. #16
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,564
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    If you have something as a .php extension the compiler / parser has to run through the file and "compoile" it to make sure no errors are given. If you render it as a .html extension the browser just renders the page. It increases loading time but the computers we have today are so fast you may not notice too much.
    Twitter-@Ryan_Reese09
    http://www.ryanreese.us -Always looking for web design/development work

  17. #17
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Centauri View Post
    On another note, I notice that your meta file include does not actually contain any php commands, so why does it have a .php file extension? - this just makes the php parser do more work than it needs to.
    In this case, using include/require will always run the file though PHP regardless of the extension. Think of it this way, include takes the contents on the file and injects it into the spot it takes up.

    PHP Code:
    <?php

    // PHP code here...index.php

    include 'head.txt';

    // More PHP code of index.php

    ?>
    After inject the file into the code in theory it would be as:
    PHP Code:
    <?php

    // PHP code here...index.php

    ?>
    Text text...
    <?php

    // PHP code in head.txt

    ?>
    more text...
    <?php

    // More PHP code of index.php

    ?>
    head.txt is treated as PHP content regardless of the extension.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  18. #18
    SitePoint Wizard silver trophybronze trophy
    Join Date
    Jul 2008
    Location
    New York, NY
    Posts
    1,432
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Corrected Version:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    
    <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>...</title>
    You left off the " before the http:
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"

    You are missing the title as well.

  19. #19
    SitePoint Enthusiast
    Join Date
    Apr 2006
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well spotted, that wasn't the problem though. As mentioned above, it was the page encoding forcing IE into quirks mode.

    Also, the title appeared much further down, and not pasted in that section of code.


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
  •