[RESOLVED] IE5 creates space for no reason on page load, but is ok on refresh
Hi all,
I am just in the middle of doing some cross browser testing and I have a major problem. As my site is about the UK military, I need it to be compatable with IE5 as they use IE5 alot.
I have created this script in the head of the documents to use a different CSS document if it is IE version 4, 5.0 or 5.5.
PHP Code:
<?php
// Start of MSIE script
$list=$_SERVER['HTTP_USER_AGENT'];
$explode=explode(';', $list);
$vs=$explode['1'];
$query_MSIE="SELECT IF (SUBSTRING('$vs',7,1)=5, '<link rel=\"stylesheet\" type=\"text/css\" href=\"../css/MSIE5.css\" />', '<link rel=\"stylesheet\" type=\"text/css\" href=\"../css/layout.css\" />') AS header;";
$MSIE=mysql_query($query_MSIE, $campaign) or die (mysql_error());
$row_MSIE=mysql_fetch_assoc($MSIE);
echo $row_MSIE['header'];
// End of MSIE script
?>
If you need the code to the page itself let me know and I''ll have to post seperately as this has just given me a warning about having too many characters
The 100% fix can be problematic if we're talking about IE5/Win (not mac, which doesn't have the hasLayout DOM property). IE5 gets the box model wrong, so be wary of adding width: 100% to elements that have padding and borders. I've found the following snippet of code a little more fail-safe for triggering hasLayout:
HTML Code:
<!--[if IE]><style type="text/css" media="screen">
#someId {
height: 1px; /* IE5 is less buggy with this */
voice-family: "\"}\"";
voice-family: inherit;
height: auto; /* Reset height, mainly for IE7 */
zoom: 1; /* Trigger hasLayout */
}
.fixIE501 {/* IE 5.01 often ignores the declaration after a voice-family hack. */}
</style><![endif]-->
The internet explorer conditional comments hide the errant IE-Win CSS styles for non-IE browsers (and thus will pass validation).
IE5? Are you serious? That browser was replaced over five years ago. Are you seriously recomending someone code their site for people too lazy to update their browser to the latest free offering after five years of being obsolete?
Normaly I would agree but as this websiet is based on the British military, I need it to be compatible with IE5 as they are still using it in many areas
Bookmarks