DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Chara has posted 50 posts at DZone. View Full User Profile

Targeting Chrome With CSS

07.07.2014
| 4667 views |
  • submit to reddit
<style type="text/css">
@media screen and (-webkit-min-device-pixel-ratio:0) {
    H5 { color:red; }
    P { margin-left:20px; }
    /* other special styles for Chrome here */
}
</style>
// source: http://www.apphp.com/index.php?snippet=css-targeting-chrome-only

This solution is based on Chrome specific CSS extension. Other browsers will ignore this rule.