In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "what are the knowledge points of CSS Hack". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the knowledge points of CSS Hack".
I. the concept of CSS Hack
Due to the different browsers of different manufacturers or different versions of a reader (such as IE,Firefox/Safari/Opera/Chrome, etc.), the support and resolution of CSS are different, resulting in different page display effects in the environment of different readers. At this time, in order to achieve a unified page effect, we need to write specific CSS styles for different readers or different versions.
The process of writing CSS code for different readers / different versions is called CSS hack!
Second, the principle of CSS Hack
Because different readers and different versions of readers have different support and parsing results for CSS, as well as the influence of CSS priority on the display effect of readers, we can apply different CSS for different readers.
III. Classification of CSS Hack
3.1 CSS attribute prefix method (that is, Hack within the class)
(1) IE6 can recognize the underscore "_" and the asterisk "*".
(2) IE7 can recognize the asterisk "*" but not the underscore "_".
(3) IE6~IE10 recognizes "9".
(4) none of the three mentioned above can be recognized by firefox.
3.2Selector prefix method (i.e. selector Hack)
(1) IE6 can recognize * html .class {}
(2) IE7 can recognize * + html .class {} or *: first-child+html .class {}.
3.3 IE conditional annotation (that is, if IE Hack is invoked in the HTML header)
(1) all IE (Note: IE10+ no longer supports conditional comments) can recognize
(2) IE6 and below can recognize
This type of Hack works not only for CSS, but for all code written in the discriminant statement.
(3) most of the practical projects introduce CSS Hack according to the performance differences between different versions of IE readers.
IV. CSS Hack Writing order
Generally speaking, CSS, which has a wide range of application and strong ability to be recognized, is defined in front.
5. CSS Hack IE conditional annotation method
This method is the proprietary Hack mode of IE Reader and the hack method officially recommended by Microsoft.
5.1 it only takes effect on IE
5.2 it only takes effect on IE6
5.3.It only takes effect on IE6+
5.4.Only if IE8 is not valid
5.5 non-IE readers take effect
6. Prefix method for internal attributes of CSS Hack class
The attribute prefix method is to prefix the CSS style attribute name with some hack prefixes that can only be recognized by a specific reader in order to achieve the desired page display effect.
Thank you for your reading, these are the contents of "what are the knowledge points of CSS Hack". After the study of this article, I believe you have a deeper understanding of what are the knowledge points of CSS Hack, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.