2

I usually use the Yandex browser, and there is no problem until I tested my web app with Chrome. Chrome and Yandex browsers were showing me 2 different styles. So I want to add styles to only the Chrome browser for fixing style bugs.

I tried to find how to add styles to only the Chrome browser, but I couldn't find any. Then I actually want to add another style for only the Chrome browser.

Robert Bradley
  • 548
  • 2
  • 21
Hakimov-dev
  • 234
  • 2
  • 10
  • Does this answer your question? [How to apply specific CSS rules to Chrome only?](https://stackoverflow.com/questions/9328832/how-to-apply-specific-css-rules-to-chrome-only) – Robert Bradley May 11 '23 at 16:35
  • Unless it's breaking and looks bugged I wouldn't bother making it identical. Small differences between browsers in styles are acceptable, think about how they all handle inputs and scrollbars, so apart from you it's not likely anyone else will notice tiny differences. – Sead May 12 '23 at 21:51
  • It's usually best practice to upvote an answer as well as accept it. – Robert Bradley May 15 '23 at 21:37

1 Answers1

1

This should work:

@media screen and (-webkit-min-device-pixel-ratio: 0) and (min-resolution: 0.001dpcm) {
    /* Styles for Chrome only here */
}

And this guide page on BrowserStack should be useful if you need more information, or if you need to do it with other browsers as well.

Robert Bradley
  • 548
  • 2
  • 21