Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How can I get IE7 to interprete #include without an anoying 'margin'

    I'm having my HeaderLogo + Menu in an #include file (header_inc.htm) to have it in all web-pages.
    In IE7 the pages (header) start with a blank space line 10-15px, and in IE8 and most other it doesn't start with this kind of 'margin'.

    I thought that it had something to do with CSS and styles of divs but it can't be as if I do copy all text of #include file into the pages there is no 'margin' showed, which is what I want. But I really need the menu to be included to have minimal changes instead of 1000s of changes.

    Any clues what I can do for the IE7 and other browsers that interprete the #include with a 'margin' of 10-15px ?

    Thanks in advance

  • #2
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,956
    Thanks
    9
    Thanked 727 Times in 721 Posts
    It must be something in your css or a different default margin setting - the include by itself will not introduce any extra margin.

    Have you reset all your paddings/margins to zero via:

    Code:
    *{margin:0px;padding:0px}
    If you have, then it must be something else and we need a link to your page.

  • #3
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question

    First I want to thank you for your quick reply

    I have tried all kind of margins/paddings to 0 - and why I say it can't be something with the CSS is that - if I copy the whole content of the include (pure HTML) and paste it into a few of the pages instead of the :
    <!--#include virtual="/header_inc.htm"-->line, there is no whitespaces at top.
    It is only IE7 and ApleSafari 4.0.4 I have tested to do it wrong
    IE8, Opera, FireFox does it well

    I can't for now give you a link to website - but I might find a way later to reconstructor a similar page on another server.

    Thanks for trying

    PS. I did try *{margin:0px;padding:0px} just in case

  • #4
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question

    ok - I have made 2 mini-shtml files that is exactly the same content vice, but the 1st of them is having the header in an #include-file and the 2nd I have copied the exact html from the include-file into the shtml-page (which shouldnt actually be an shtml anymore as there is no server-request anymore but anyway)

    In IE7 the included page, with include, is showing a horizontal white-space, as if there was a margin, instead of having the logo inTop as in without include!

    I've set the 2 files link to the right of content so you can togle it there

    Maybe its one.com's server-response that does it - I unfortunately couldn't try it out on my other server, as it hasn't a server-response activated
    I will appreciate it very mucy if any1 can try that out for me

    Thanks in advance

  • #5
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,956
    Thanks
    9
    Thanked 727 Times in 721 Posts
    Comparing the two files using the IE Dev toolbar your page with the include shows as having some text both before and after the comment "<!-- Begin of Header //-->". I'm guessing that this might be a space. Are there any space characters before your include? If so try deleting these...

    Ah, same problem in Chrome - which shows two quotes and a dash appearing in the html before the include.

    EDIT: Your <meta> and <link> elements are closed - which isn't required with HTML4 (only with XHTML) - the validator is throwing this as an error - worth sorting these out as well.
    Last edited by SB65; 06-17-2010 at 03:54 PM.

  • #6
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have done that before - but just to be sure I deleted all coments....

    I can't check it here (home) as I don't have IE7 installed

    So I actually doesn't know if it cured the problem - but my guess is that it didn't.
    ---------------------------edited----------------------------
    Ok - I just tried the Browser Sandbox to simulate IE7 and it's still the same
    Last edited by Maricha; 06-17-2010 at 06:54 PM. Reason: used Browser Sandbox


  •  

    Tags for this Thread

    Posting Permissions

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