In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces "what are the advantages of IE conditions". In daily operation, I believe many people have doubts about the advantages of IE conditions. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "what are the advantages of IE conditions?" Next, please follow the editor to study!
Overview
If you are tired of writing smelly and long hack,IE conditional comments for a lower version of IE, it will be a more elegant solution. Of course, the function of conditional comments is not only those functions mentioned above, in addition to avoiding writing disgusting hack, it can also make different responses for different versions of IE (IE5.5-9 IE IE10 does not support conditional comments), such as loading different styles for different IE, or scripts, and so on, more functions are waiting for us to explore and use.
Introduction to conditional comments
Conditional comments (Conditional comments) in IE have excellent ability to distinguish between IE version and IE non-IE, and it is a commonly used hack method in WEB design.
Conditional comments can only be used above IE5, but not above IE10.
If you have more than one IE installed, the conditional comments will be based on the highest version of IE.
The basic structure of conditional comments is the same as HTML's comments (). So browsers other than IE will treat them as normal comments and ignore them completely.
IE will determine whether to parse the content of the conditional comments in the same way as the normal page content based on the if condition.
Conditional annotation syntax
Project example description! [if! IE] The NOT operator. This is placed immediately in front of the feature, operator, or subexpression to reverse the Boolean meaning of the expression.
NOT operator. This is immediately in front of the function of the operator, or subexpression to reverse the meaning of the Boolean expression. Lt [if lt IE 5.5] The less-than operator. Returns true if the first argument is less than the second argument.
Less than operator. Returns true if the first parameter is less than the second parameter. Lte [if lte IE 6] The less-than or equal operator. Returns true if the first argument is less than or equal to the second argument.
Less than or equal to the operation. Returns true if the first parameter is less than or equal to the second parameter. Gt [if gt IE 5] The greater-than operator. Returns true if the first argument is greater than the second argument.
Greater than the operator. Returns true if the first parameter is greater than the second parameter. Gte [if gte IE 7] The greater-than or equal operator. Returns true if the first argument is greater than or equal to the second argument.
Greater than or equal to the operation. Returns true if the first parameter is greater than or equal to the second parameter. () [if! (IE 7)] Subexpression operators. Used in conjunction with boolean operators to create more complex expressions.
Subexpression operator. The Boolean operator is used to create more complex expressions. & [if (gt IE 5) & (lt IE 7)] The AND operator. Returns true if all subexpressions evaluate to true
AND operator. If all subexpressions evaluate to true, return true | [if (IE 6) | (IE 7)] The OR operator. Returns true if any of the subexpressions evaluates to true.
OR operator. Returns true if the subexpression evaluates to true.
Example of how to use conditional comments
Visible only by IE5.5
Only visible above IE 5.5
Visible only below IE 5.5
IE 5.5 and above can be seen
IE 5.5 and below is visible
IE visible for non-IE 5.5i
Conditional comment use case
Special hint:
1. Someone will try to use
At this point, the study of "what are the advantages of IE conditions" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.