CSS hack

CSS hacks are sometimes used to achieve consistent layout appearance in multiple browsers that do not have compatible rendering.

Most of these hacks do not work in modern versions of the browsers, and other techniques, such as feature support detection, have become more prevalent.

[1] Although newer CSS rules are correct by current standards, they are ignored by older browsers as "invalid".

However, due to the proliferation of these properties in live code, the browser vendors have begun moving away from this practice in favor of feature flags.

Multiple JavaScript libraries exist to detect what features are available in a particular browser so that CSS rules can be written to target them.

Since polyfills add or fix functionality in browsers that do not have it, they serve a different purpose than feature queries, but can be used in combination with them.