conditional comments

Discussion in 'HTML' started by David Graham, Jul 22, 2003.

  1. David Graham

    David Graham Guest

    Hi
    I have some problems getting my site to render properly in IE5 for win
    2000 - although I've been told its OK in IE5 for win98. Is it possible for a
    different version of windows to do this? Can anyone confirm that IE5 is OK
    on win98. What does IE5.5 make of this page?

    http://www.catalysys.co.uk/sefriendly/

    I know its a simple page and it should render Ok in any browser and indeed I
    am currently working on simplifying things. My main complication is the
    extra complexity caused by having a div called 'internet page'. This div
    gives me the ability to have a footer that appears at the bottom of the view
    port or the canvas if the canvas is longer. I might get rid of this feature
    as it might be part of the problem.
    The problem is IE5 on win2000 and IE5.2 mac do not respect the relative
    position of 200px left on the 'contentcontainer' div, so it all ends up
    pressed against the left side of the screen. While I'm working on the
    problem, would the code below give me an opportunity to redirect these two
    browsers.


    <!--[if lte IE5.2]>
    <?php header("Location: http://www.xxx.com/");?>
    <![endif]-->

    I don't know if it is possible to be more specific in the condition like
    this

    <!--[if ((lte IE5.0 && win2000) || (macintosh && 5.2))]>
    <?php header("Location: http://www.xxx.com/");?>
    <![endif]-->

    Does that look like it has a chance of working - this is only a stop gap
    while I correct the real problem i.e. a bloated page with dodgy code

    thanks
    David
     
    David Graham, Jul 22, 2003
    #1
    1. Advertising

  2. David Graham

    Chris Morris Guest

    "David Graham" <> writes:
    > <!--[if lte IE5.2]>
    > <?php header("Location: http://www.xxx.com/");?>
    > <![endif]-->


    This won't work, for multiple reasons.

    1) PHP can't send headers after any body content (like that comment).

    2) Even if you use output buffering or other tricks to get around
    that, the header gets sent separate to the body, so it won't 'appear'
    inside the conditional comment, and everyone gets redirected.

    You *could* use a <meta> or Javascript-based refresh here, as a
    temporary measure, assuming the conditional comment is in the document
    head.

    --
    Chris
     
    Chris Morris, Jul 22, 2003
    #2
    1. Advertising

  3. David Graham

    Chris Morris Guest

    "David Graham" <> writes:
    > The meta refresh could be like this?
    >
    > <meta http-equiv="refresh" content="5; url=http://www.xxx.com/">
    >
    > If I wanted it to happen as instantly as possible, do I just leave out the
    > five and the semicolon?


    The 5 is a time in seconds. You could theoretically do 0 or 1. The
    implementation of meta refresh isn't great, though. As long as it's
    very temporary while you fix the underlying problem it shouldn't be so
    bad, though.

    That said, meta refresh is really inconvenient in screen readers /
    speech browsers, lots of which may use IE as their HTTP (and sometimes
    HTML-parsing) agent.

    > Can the url be relative as opposed to absolute?


    *Some* browsers let you get away with that, I can't remember if IE5 is
    one of them. It's supposed to be absolute, though.

    --
    Chris
     
    Chris Morris, Jul 22, 2003
    #3
  4. David Graham

    Brian Guest

    David Graham wrote:
    >
    > http://www.catalysys.co.uk/sefriendly/
    > I have some problems getting my site to render properly in IE5 for win
    > 2000 -


    Yep, it ain't pretty. Things overlap.


    > although I've been told its OK in IE5 for win98. Is it possible for a
    > different version of windows to do this?


    Of course.

    > I know its a simple page and it should render Ok in any browser and indeed I
    > am currently working on simplifying things. My main complication is the
    > extra complexity caused by having a div called 'internet page'. This div
    > gives me the ability to have a footer that appears at the bottom of the view
    > port or the canvas if the canvas is longer. I might get rid of this feature
    > as it might be part of the problem.


    I can't say, yet. See below.

    > would the code below give me an opportunity to redirect these two
    > browsers.
    >
    > <!--[if lte IE5.2]>
    > <?php header("Location: http://www.xxx.com/");?>
    > <![endif]-->


    Before trying the difficult solution, which may not work, and which
    will be harder to maintain, consider checking your css for errors.

    < http://jigsaw.w3.org/css-validator/ >

    http://jigsaw.w3.org/css-validator/validator?uri=http://www.catalysys.co.uk/sefriendly/&profile=css2

    If you need to have different css layouts, it's much easier to simply
    exploit browsers' bugs or inability to parse certain css instructions.

    < http://w3development.de/css/hide_css_from_browsers/ >

    And keep things simple. You'll be glad in the long run.

    --
    Brian
    follow the directions in my address to email me
     
    Brian, Jul 22, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    6
    Views:
    502
    Andy Dingley
    Dec 27, 2003
  2. e n | c k m a

    Quick Conditional Comments Question

    e n | c k m a, Jul 20, 2004, in forum: HTML
    Replies:
    8
    Views:
    426
    e n | c k m a
    Jul 20, 2004
  3. Alec S.
    Replies:
    10
    Views:
    10,269
    Alec S.
    Apr 16, 2005
  4. vunet
    Replies:
    5
    Views:
    655
    Harlan Messinger
    Oct 16, 2008
  5. David Mark
    Replies:
    4
    Views:
    319
    David Mark
    May 13, 2010
Loading...

Share This Page