Hi,
Is there such a thing as conditional comments for Chrome?
I have a page that renders differently in chrome compared to firefox.
Thanks
Hi,
Is there such a thing as conditional comments for Chrome?
I have a page that renders differently in chrome compared to firefox.
Thanks
<!--[if IE 8]><div id="bodyContainer" class="IE8"><![endif]-->
<!--[if !IE]>--><div id="bodyContainer" class="W3C"><!--<![endif]-->
<script type="text/javascript">
if (navigator.userAgent.toLowerCase().match('chrome') && document.getElementById('bodyContainer'))
document.getElementById('bodyContainer').className = document.getElementById('bodyContainer').className + " chrome";
</script>
Then you use CSS to tweak your styles specifically for Chrome.
Both HTML conditional comments and Javascript conditional compilation directives are only supported by Internet Explorer 4-8 to the best of my knowledge.
You can target WebKit based browsers using this in your CSS
@media screen and (-webkit-min-device-pixel-ratio:0) {
Body {}
}
Perhaps this will help?
@media screen and (-webkit-min-device-pixel-ratio:0) { Body {} }
...works great for me. Thanks George!
Seriously? Why is this not simple like the Ie fix. Granted, everyone hates ie, but why not something simple for chrome? I mean, I'm looking at what's up above here, and - yeah, maybe it works - but why is this example not targeting a CSS document? I thought that's what the purpose of this was? Not just to say "Oh, hai Chrome!"