


Detailed explanation of the classification of css hack and the three methods of css hack
The full text is quoted from here, a great article
what
Due to browsers from different manufacturers or different versions of a certain browser ( IE6~IE11, Firefox/Safari/Opera/Chrome, etc.) have different support and parsing of css. At this time, in order to obtain a unified page effect, we need to write specific css styles for different browsers or different versions. This process of writing corresponding css code for different browsers/different versions is called css hack.how
Because different browsers and browser versions have different support and parsing results for css, and css priority The impact on the browser display effect, we can apply different css according to different browser scenarios.css hack classification
has three forms of expression, cssattribute prefix method, selector prefix method, and IE conditional comment method .Attribute prefix method (i.e. class internal hack)
Selector prefix method
IE conditional comment method
css hack generally defines CSS that has a wide range of applications and strong recognition capabilities at the front.css hack method one: conditional comment method (applicable to IE10 and below, IE10 and later will no longer support conditional comments)
gt: greater than, select the conditional version or above, excluding the conditional version.
lt: less than, select the version below the conditional version, excluding the conditional version.
gte: greater than or equal, select the conditional version or above, including the conditional version.
lte: less than or equal, select the version below the conditional version, including the conditional version.
! : Select all versions except the conditional version, regardless of high or low.Conditional comment attributes:
-
Example
<!--[if IE]> <p class="p1">只在IE5、6、7、8、9下显示</p> <![endif]--> <!--[if ! IE]><!--> <p class="p5">非IE</p> <!--<![endif]-->
Common comment method in html script ##
, the conditional comment method can only be recognized by
IE browsers below IE10. For other browsers, they can only see a pair of closed Comments that don't work. For non-IE comments, note that there is a
The above is the detailed content of Detailed explanation of the classification of css hack and the three methods of css hack. For more information, please follow other related articles on the PHP Chinese website!

The fact that anchor positioning eschews HTML source order is so CSS-y because it's another separation of concerns between content and presentation.

Article discusses CSS margin property, specifically "margin: 40px 100px 120px 80px", its application, and effects on webpage layout.

The article discusses CSS border properties, focusing on customization, best practices, and responsiveness. Main argument: border-radius is most effective for responsive designs.

The article discusses CSS background properties, their uses in enhancing website design, and common mistakes to avoid. Key focus is on responsive design using background-size.

Article discusses CSS HSL colors, their use in web design, and advantages over RGB. Main focus is on enhancing design and accessibility through intuitive color manipulation.

The article discusses the use of comments in CSS, detailing single-line and multi-line comment syntaxes. It argues that comments enhance code readability, maintainability, and collaboration, but may impact website performance if not managed properly.

The article discusses CSS Selectors, their types, and usage for styling HTML elements. It compares ID and class selectors and addresses performance issues with complex selectors.

The article discusses CSS priority, focusing on inline styles having the highest specificity. It explains specificity levels, overriding methods, and debugging tools for managing CSS conflicts.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Zend Studio 13.0.1
Powerful PHP integrated development environment
