WeLoveCSS Logo
Home Profile Members Search Rules Help New Posts



WeLoveCSS > WEB DESIGN > CSS > CSS Hack for Google Chrome

Reply
  Thread Tools Display Modes
Old 19th September 10, 02:14 PM   #1
Alexancho
WLC Member
 
Join Date: Aug 2009
Posts: 16
Default CSS Hack for Google Chrome

I need a one div to be in Chrome only, so i used a code:
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:
Quote:
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?
Alexancho is offline   Reply With Quote
Old 19th September 10, 02:27 PM   #2
meesa
WLC Mod
 
meesa's Avatar
 
Join Date: Jul 2009
Location: Milky Way Galaxy
Posts: 3,140
Default Re: CSS Hack for Google Chrome

That's the best solution out there. Really, you're CSS is fine, it's just that the validator doesn't know that one small thing (Which is good, you only want Chrome [Safari gets it too] to see it.) so it calls it as an error.
__________________
Praise be to the Lord God for the ability to learn, the capability to analyze, and the time to help users on this forum.
meesa is offline   Reply With Quote
Old 19th September 10, 04:46 PM   #3
Alexancho
WLC Member
 
Join Date: Aug 2009
Posts: 16
Default Re: CSS Hack for Google Chrome

Thank you very much!
Alexancho is offline   Reply With Quote
Reply


Thread Tools
Display Modes
Linear Mode Linear Mode

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:03 AM.



Home | Advertise | Contact Us | Top
Home | Advertise | Contact Us | Top

Copyright© 2006 WeLoveCSS.com. All Rights Reserved.
Powered by vBulletin Version 3.8.4 Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.