Jump to content

Huge margin top gap in IE6


Dada78

Recommended Posts

I know this browser isn't widely used, heck I even use FF3. There are some though that are still living in the stone age and I like my site to render the same regardless. So with that said. in IE6 only their is a HUGE gap at the top of the page before the content starts that does not show up in IE7 or FF. I have been trying to fix this for months and can not get it right. Any idea why this is happening? I am running out of time and could greatly use the help and suggestions.

 

If happens on two page in IE6, this one...

 

http://www.mesquitechristmas.com/local/browse.php

 

and this one....

 

http://www.mesquitechristmas.com/local/display.php?id=%2061

 

If you need me to post some code for these isolated problems I would be glad to. Otherwise you can just view source of the code to see it.

 

-Thanks

 

Link to comment
Share on other sites

There is a very good chance it is because of the whitespace before your doctype on those pages. On the first page you have 2 lines and a space, and on the second page you have a line and a space. You should take all spaces out from before the doctype on all pages (I noticed it on another page as well). That white space can put IE6 into quirks mode, which makes it act...quirky.

Link to comment
Share on other sites

I am not sure how you are viewing it, but I don't see any white space above the doctype. I have even opened the files up to double check, it there was no white space. I have php code before the html starts so you might be seeing it because of the php code there. But I am not seeing any white space. It wouldn't matter much when it comes to HTML documents, only with php.

 

The strange thing though is if I change the width of the first table from 100% to less or to a px width then it will line it to the top, but add white space below it. It is really strange but it is frustrating the hell out of me.

Link to comment
Share on other sites

It wouldn't matter much when it comes to HTML documents, only with php.

 

It does matter with HTML documents, because IE6 goes into quirks mode if you have whitespace before the doctype.

 

As for having php before the doctype, well you have to make sure that there is no whitespace between any closing and opening (in that order) php tags you have, or between any closing tags and the doctype.

 

I think you *may* be allowed one carriage return after a closing php tag and before your doctype. I read that somewhere once, but I personally don't leave anything between the closing php tag and the doctype.

 

You also have to make sure there is no whitespace before your opening php tag.

Link to comment
Share on other sites

It really doesn't matter about white space before or after the html tag because browsers will only render what is between those tags. Which is why I said it only matters with php. You are right about that, you can not have white space before or after php tags because then you will get errors. You can have one return before and after, but sometimes that will throw an error. Good practice I delete any white space before and after php tags. Therefore I have no white space, so I am not sure what you are seeing because I have double checked and their is none. See the screenshot below and the link to view the code.

 

http://www.mesquitechristmas.com/local/display.txt

Link to comment
Share on other sites

It really doesn't matter about white space before or after the html tag because browsers will only render what is between those tags.

 

I don't know if you are trying to be difficult, but as I said before, IE6 sometimes goes into quirks mode when there is whitespace before the doctype. Which would appear to be the problem you are having, as you still have whitespace before your doctype (use view source in your browser if you don't believe me, it's right there for all to see).

 

As for where it's coming from, well you may want to check inside these files:

 

include ('db_connect.php');
include ('utiles.php');

Link to comment
Share on other sites

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

 

I viewed this source code under IE6. TAke out the whitespace as Haku explained it. He is absolutely correct. - I know it doesn't make sense, but trust me IE6 is crap and little whitespace does make it go into quirks mode.

Link to comment
Share on other sites

Listen I am not trying to be difficult but you are wrong about the white space. You are not listening to what I am saying about the table. HTML ONLY renders what is between the HTML tags so space before or after is not going to matter unlike with php. That would not explain why I can change the size of the table it brings it to the top and adds the gap below the table then.

 

This table right here...

 

<table class="imgBox" width="100%" cellpadding="0" cellspacing="0">
     <tr>
     <td align="center">
<table class="fullbox" align="center" width="100%" cellpadding="3" cellspacing="1">
     <tr>
     <td align="center"><img src="/local/submitted/<? echo $row['imgurl1']; ?>" alt="<? echo $row['displayname']; ?>" class="border" width="520" height="320" id="big" /></td>
  </tr>
  <tr> 
    <td align="center"><img src="/local/submitted/<? echo $row['imgurl1']; ?>" alt=" " height="60" width="60" onclick="getElementById('big').src=this.src" />
<img src="/local/submitted/<? echo $row['imgurl2']; ?>" alt=" " height="60" width="60" onclick="getElementById('big').src=this.src" />
<img src="/local/submitted/<? echo $row['imgurl3']; ?>" alt=" " height="60" width="60" onclick="getElementById('big').src=this.src" />
<img src="/local/submitted/<? echo $row['imgurl4']; ?>" alt=" " height="60" width="60" onclick="getElementById('big').src=this.src" />
<img src="/local/submitted/<? echo $row['imgurl5']; ?>" alt=" " height="60" width="60" onclick="getElementById('big').src=this.src" />
</td>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td><td class="shadow-mid" width="100%"><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td><td><img alt=" " border="0" height="7" src="/images/1pixel.gif" width="7" /></td></tr></table>
    </td>
  </tr>
</table>

 

If I change the first tables width from 100% to say 600px then it will bring that table to the top and move the huge gap to below that table instead. If white space was the problem, which it is not, then it would move everything down including the text in the <h> tags and it does not. It only effects that table. I appreciate the help, but you have to listen to what I am telling you. If you are not going to listen and analyze what I am saying their is no sense in trying to help because you are wasting my time and yours. I have no white space at all I have triple checked these files and I can not erase something that is not there. Here is a screen shot of the view source, as you can see no white space.

 

Here is the view source screen shot, as you can see no Whitespace.

 

nowhitespace.GIF

 

 

 

 

 

 

I have changed the ext to text so you can see the exact file as it is on the server. As you see, no white space. Even in the included files, no white space. What is the pattern here, NO white space. Their is something wrong with how that table is layed out but I am not sure as to what. It only happens on two page and only with IE6.

 

 

http://www.mesquitechristmas.com/local/display.txt

 

 

-Thanks

 

 

Link to comment
Share on other sites

Because you are viewing that in Firebug, it always adds a space to the top and bottom. If you view the raw source (right click, view source) you will not see that gap. I am telling you their is no gap on mine and on the file. I have showed you what I am seeing and what I have. How can I erase what is not there? I have triple checked and tried to erase it and nothing is there.

 

That doesn't explain why if I remove that first table everything lines up and works fine. I add that table back at 100% the gap comes back. I change the px or % of that table to less then 100% the table lines to the top but moves the gap to below it. The problem is with that table, not with any whitespace you might be seeing. What the problem is with that table, I am not sure which is what I am trying to resolve.

Link to comment
Share on other sites

The irony is:

A) There is still whitespace there, in both FF and IE

B) I just checked it in IE6, and there is no blank space at the top

 

 

Almost makes me wonder if you posted the wrong link, and have been checking the whitespace a different page than the one you linked to.

Link to comment
Share on other sites

Well you are using some other plugin to view it then because my screenshot is of the source when you right click and select view source. It doesn't have all that fancy windows which looks like firebug, or you are viewing it in the web developer plugin in. Look at my screen shot. Do you see all that?

 

You must be looking at the wrong page because I have the page in question set to txt file so when you try to view it it will be txt not a html page. I have posted the link above twice. If you are seeing an actual HTML page you are looking at the wrong page...

Link to comment
Share on other sites

Well then you are using some other version of FF. I am using the latest version for FF3, just upgraded last week and my does not look like that as shown in my screen shot. Your version is probably adding that gap to the top. When I RIGHT CLICK then select VIEW PAGE SOURCE the screen shot I post is what mine looks like and it does not have no gap. You can even read the title of that window in that screen shot. It says "source of so in so page". Oh wait a minute, it might be the theme you are using that is causing that. If you are using a different them it probably adds makes a different view source page.

 

Regardless, it is not the cause of the gap. Like I said, if I change he width of the table it moves it up but then moves the gap to below the table instead of above it. Also it white space was the cause then why is all the text and header text not moved down also? Thank about that an anwser me that. The gap is between the table and the top paragraph text and the header text. No sense to argue over white space when that is not the issue.

Link to comment
Share on other sites

Dada78 - did you even try the suggestion Haku and I have provided? Afterall you have 14 years of experience, so I'm sure you understand that it doesn't hurt to try what other - experienced - developers suggest. Trust me, Haku is entirely correct, whitespace before the source code makes it go into quirks mode! This happened to me before, so I can speak from experience and not from prior knowledge.

 

I am using IE6 and you DO have two lines of whitespace in the source code.

Link to comment
Share on other sites

DUDE you are NOT listening to what I am saying I have LOOKED MANY TIMES in the file and their is NO white space is in that file. I am not ingnoring what you are saying, I have looke their is nothing there, I have even showed you a screen shot and have the file available with a txt ext so you can see. Tell me how I am suppose to remove something that is NOT there. I have showed you a screen shot of the source code from what I am see on the first page and you can view the file in it's contents from this link...

 

http://www.mesquitechristmas.com/local/display.txt

 

You keep swearing up and down their is white space and their is not any. I am telling you I have looked many times and it is not there. Besides that you are also not listening that it only renders between the HTML tags not what is outside of that.

 

I keep telling you where my problem is but you refuse to listen. I know where the problem is, just do not know why it is happening. If I remove that first table or change the width of the table call img then it the gap at the top goes away and then appears below the table. LIKE I HAVE SAID many times already that has been ignored. If their was white space and in theory then why isn't the paragraph and the text in the head shifted down that is above that table too? The gap is between that and the table. You adjust the table size and the gap moves ether above or below the table. The problem is not whitespace because it doesn't exist, it has something to do with that table, I just do not know what and is what I need help with. What else do you want me to say and show you. I have showed you everything you need to see to show you I have no white space and tell you where the problem is and you will not listen to what I am saying. If you are going to keep insisting the problem is something that is not then please quit wasting my time so I can try to get help from someone that might know what is really wrong because up to this point you do not know.

 

Link to comment
Share on other sites

Here you go chief, attached it the files. Load them and see for yourself since you do not believe what I say. I have opened in them in Crimson, PHP Designer, Dreamweaver 8 and Dreamweaver CS3. and the WYSWYG editor on my server and NO whitespace.....

 

 

 

[attachment deleted by admin]

Link to comment
Share on other sites

Schwew, gonna need an e-restraining order for you three

 

If dada says there's no white space, then maybe there's no whitespace.  It's hard to overlook.

 

Maybe it's not in your textfile dada but you may have some PHP code above the DOCTYPE that's putting that space there....

and the best advice I've heard so far was

 

As for where it's coming from, well you may want to check inside these files:

include ('db_connect.php');

include ('utiles.php');

 

I've had MySQL problems do that to me alot..putting a blank space where it didn't need be, or just giving me a completely blank page.

 

or maybe it could just be a CSS problem...which I haven't really looked at yet....just going out on a limb on that guess

Link to comment
Share on other sites

I just downloaded and opened your PHP file and there are spaces between each line, I'm on Linux - Is there at all the possibility that you have written this in Windows, and are executing it on a *NIX server? Something to do with the newline character, or the way you have saved the file? I'm just throwing things out there...

 

EDIT: Attached screenshot of source in FF3.

 

[attachment deleted by admin]

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.