Jump to content

CSS Hack for Google Chrome


Recommended Posts

I need a one div to be in Chrome only, so i used a code:

div.chrome_hack{display:none;}@media screen and (-webkit-min-device-pixel-ratio:0){div.chrome_hack{display:block;}}

It works, but causes a validation error:

110 Property -webkit-min-device-pixel-ratio doesn't exist for media screen : 0 0
Is there a better solution? And if there isn't can we say this solution is correct? Edited by Alexancho
Link to comment
Share on other sites

All browser-specific CSS causes a validation error. Those are the ones that start with -webkit, -moz, etc. If the hack works and you can live with the "error," don't worry about it. Validation is supposed to be a tool, not a blue ribbon.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...