<!--[if IE]>
<link rel="stylesheet" type="text/css" href="ie_style.css" />
<![endif]-->
The above statement say "if the browser is Internet Explorer than apply style sheet ie_style.css"
<!--[if lt IE8]>
<link rel="stylesheet" type="text/css" href="ie-8_style.css" />
<![endif]-->
The above statement will apply style sheet ie-8_style.css to all versions of IE below 8.
<!-- [if xxx]> HTML <![endif]-->
This is standard HTML comment with the IE conditional comment. So lets look at the operators:
+-----+--------------------------------------+
|! |NOT operator |
|lt |Less than operator |
|lte |Less than or equal to operator |
|gt |Greater than operator |
|gte |Greater than or equal to operator |
+-----+--------------------------------------+
+------------------+----------------------------------------------------+
|[if !IE] |if not Internet Explorer |
|[if lt IE 7] |if less than Internet Explorer 7 |
|[if lte IE 7] |if less than or equal to Internet Explorer 7 |
|[if gt IE 7] |if greater than Internet Explorer 7 |
|[if gte IE 7] |if greater than or equal to Internet Explorer 7 |
+------------------+----------------------------------------------------+
<!--[if lte IE7]>
<script language="javascript" src="ExpertsExchange.js"><script>
<![endif]-->
<!--[if IE8]>
<style>/*this is regular old CSS within the style tag*/ body {font-size:120%; font-color:red}</style>
<![endif]-->
<!--[if gt IE6]>
<p style="font-size:400%; font-color:red">Congratulations, you are using Internet Explorer version 7 or higher!</p>
<![endif]-->
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (3)
Commented:
Any idea why?
Author
Commented:These were my two previous posts.
is it an .aspx based site?
One other question...is this happening across all browsers, only in one browser, only in IE8?
have you tried (see code view below)-----will accomplish the same thing.
Open in new window
Commented:
my problem is that I don't know how to use conditional statements for something very specific.
I have designed my perfonal portfolio website www.manalelias.com and I'm encountering one specific problem both in Internet Explorer and Firefox. I am an amateur and would really appreciate an expert's help.
My navigation bar and the div below it (solid color) are absolute but I have applied the following javascript to keep them fixed (meaning they remain apparent/fixed when scrolling sideways):
<script type="text/javascript">
<!--
window.pos = function() {
if (window.scrollX != null && window.scrollY != null) return { x: window.scrollX, y : window.scrollY };
else return { x: document.body.parentNode.s
};
window.onscroll = function(e) {
document.getElementById('n
document.getElementById('u
};
-->
</script>
The probelm in IE and Firefox is major jerking of the navigation bar when scrolling sideways. I do not have this problem is Safari. And I really don't want to change the design. IF there is no solution to stop the jerking, how can I cancel the javascript only on IE and firefox?