SitePoint Sponsor |
|
User Tag List
Results 1 to 19 of 19
Thread: No center in IE
-
Feb 26, 2009, 08:31 #1
- 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.
-
Feb 26, 2009, 08:37 #2
- 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.
-
Feb 26, 2009, 08:42 #3
- Join Date
- Oct 2008
- Location
- Whiteford, Maryland, United States
- Posts
- 13,782
- Mentioned
- 16 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.Always looking for web design/development work.
http://www.CodeFundamentals.com
-
Feb 26, 2009, 08:45 #4
- 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.
-
Feb 26, 2009, 09:04 #5
- Join Date
- Oct 2008
- Location
- Whiteford, Maryland, United States
- Posts
- 13,782
- Mentioned
- 16 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...
Always looking for web design/development work.
http://www.CodeFundamentals.com
-
Feb 26, 2009, 09:10 #6
- 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'); ?>
-
Feb 26, 2009, 09:16 #7
- Join Date
- Oct 2008
- Location
- Whiteford, Maryland, United States
- Posts
- 13,782
- Mentioned
- 16 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.
Always looking for web design/development work.
http://www.CodeFundamentals.com
-
Feb 26, 2009, 09:17 #8
- 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.
-
Feb 26, 2009, 09:26 #9
- 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.
-
Feb 26, 2009, 09:27 #10
- Join Date
- Oct 2008
- Location
- Whiteford, Maryland, United States
- Posts
- 13,782
- Mentioned
- 16 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.Always looking for web design/development work.
http://www.CodeFundamentals.com
-
Feb 26, 2009, 09:50 #11
- Join Date
- May 2007
- Location
- Countryside, Sweden
- Posts
- 3,407
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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
-
Feb 26, 2009, 09:57 #12
- Join Date
- Nov 1999
- Location
- Mechanicsburg, PA
- Posts
- 7,294
- Mentioned
- 123 Post(s)
- Tagged
- 1 Thread(s)
Dave Maxwell - Manage Your Site Team Leader
My favorite YouTube Video! | Star Wars, Dr Suess Style
Learn how to be ready for The Forums' Move to Discourse
-
Feb 26, 2009, 10:02 #13
- Join Date
- Apr 2006
- Posts
- 73
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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.
-
Feb 26, 2009, 10:23 #14
- 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.
-
Feb 26, 2009, 12:02 #15
- 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.
-
Feb 26, 2009, 12:38 #16
- Join Date
- Oct 2008
- Location
- Whiteford, Maryland, United States
- Posts
- 13,782
- Mentioned
- 16 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.
Always looking for web design/development work.
http://www.CodeFundamentals.com
-
Feb 26, 2009, 15:23 #17
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
?>
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
?>
-
Mar 5, 2009, 11:06 #18
- 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>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
You are missing the title as well.
-
Mar 9, 2009, 14:58 #19
- 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