Rule Definition
These exploit IE parsing quirks to target specific versions.
Remediation
Use feature queries, responsive design, or progressive enhancement instead.
Violation Code Sample
* html .box {
width: 300px; /* IE6 */
}
*+html .box {
width: 320px; /* IE7 */
}
Fixed Code Sample
.box {
width: 320px;
}
/* If you really need conditional styles, use classes or data attributes set server-side */
.legacy .box {
width: 300px;
}
Reference
http://interactivevolcano.com/ie-specific-css-styles
https://dev.to/koolkamalkishor/css-techniques-for-cross-browser-compatibility-and-styling-2cp4
MDN – Browser compatibility & feature detection:
https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Feature_detection
W3C – CSS Conformance (standards-compliant parsing):
https://www.w3.org/TR/CSS21/conform.html
Related Technologies
Technical Criterion
Programming Practices - Structuredness
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.