Disallow star hack
Pages 49
-
LoadingHome
-
LoadingAbout
-
LoadingAvoid un anchored hovers
-
LoadingBeware of box model size
-
LoadingBuild System
-
LoadingBuild System Integration
-
LoadingBulletproof font face
-
LoadingCommand line interface
-
LoadingContributing
-
LoadingDeveloper Guide
-
LoadingDisallow !important
-
LoadingDisallow @import
-
LoadingDisallow adjoining classes
-
LoadingDisallow box sizing
-
LoadingDisallow duplicate properties
-
LoadingDisallow empty rules
-
LoadingDisallow IDs in selectors
-
LoadingDisallow negative text indent
-
LoadingDisallow non alphabetical
-
LoadingDisallow outline:none
-
LoadingDisallow overqualified elements
-
LoadingDisallow qualified headings
-
LoadingDisallow too many floats
-
LoadingDisallow underscore hack
-
LoadingDisallow units for zero values
-
LoadingDisallow universal selector
-
LoadingDon't use too many web fonts
-
LoadingIDE integration
-
LoadingNew Release
-
LoadingRequire all gradient definitions
-
LoadingRequire fallback colors
-
LoadingRequire shorthand properties
-
LoadingRequire use of known properties
-
LoadingRules
-
LoadingRules by ID
-
LoadingSource Code
-
LoadingUnit Tests
-
LoadingUsing in a Node.js Application
-
LoadingWorking with Rules
Clone this wiki locally
The star hack is a famous (or perhaps infamous) technique for applying CSS properties only to Internet Explorer prior to version 8. By placing an asterisk immediately before the property name, older versions of Internet Explorer treated as if the asterisk isn't there while other browsers simply ignore it. For example:
.mybox {
border: 1px solid black;
padding: 5px;
width: 100px;
*width: 200px;
}In this example, the *width property is treated as if it were width by Internet Explorer 7 and earlier, so it uses the value of 200px; other browsers skip that property and use the value of 100px.
Star hack relies on an old CSS parser bug in Internet Explorer, and as such, some prefer not to use it.
Rule Details
Rule ID: star-property-hack
This rule is aimed at eliminating the use of the star hack in CSS. As such, the rule warns when it finds a property preceded with an asterisk.
The following patterns are considered warnings:
.mybox {
border: 1px solid black;
*width: 100px;
}Further Reading
``$ {webkit-tap-highlight-color: rgba(255,255,0,0);}