Is there such a thing as conditional comments for Chrome?
I have a page that renders differently in Chrome when compared to Firefox.
Thanks
Is there such a thing as conditional comments for Chrome?
I have a page that renders differently in Chrome when compared to Firefox.
Thanks
Both HTML conditional comments and Javascript conditional compilation directives are only supported by Internet Explorer 4-8 to the best of my knowledge.
This isn't just a Chrome conditional comment - this hits all browser that aren't IE... firefox, safari, etc. If using PHP - try this:
Credit to John for posting: http://www.killersites.com/forums/topic/2731/firefox-google-chrome-browser-detecion-using-conditional-comments-hack/
Then you use CSS to tweak your styles specifically for Chrome.
The conditional operation will work because other browsers will parse the If IE8 block as an HTML comment, but not the !IE block because the inside of it is wrapped in --> and
Therefore, for all non-IE browsers the body class will indeed equal W3C.
This is all by the way, though, because the IE comment block is not needed to identify the browser specifically as chrome - the JS block on its own will do that, provided the user has JS turned on of course.
You can target WebKit based browsers using this in your CSS
Perhaps this will help?