conditional comments

D

David Graham

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
 
C

Chris Morris

David Graham said:
<!--[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.
 
C

Chris Morris

David Graham said:
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.
 
B

Brian

David said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top