The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › Chrome specific?
Is it possible to make a rule just for chrome?
I have this textarea box with a border and box-shadow and appears in this browser with more 2px so I need to correct that.
I used some jQuery for this recently.
$(document).ready(function(){ var Chrome = false; if (navigator.userAgent.toLowerCase().indexOf('chrome') > -1) { Chrome = true; $('body').addClass('chrome'); } });
This will add the class of ‘chrome’ to your body tag.
I seen both of these ways in a blog post, (never tried either).
@media not all and (-webkit-min-device-pixel-ratio:0) { #example { width: 200px; } }
and