Yes, only with HTML, only CSS, you cannot adhere to a different style for Safari, Chrome and Opera, since all three use the same -webkit flag for styling using css
therefore possible solutions - Detecting the browser using javascript and adding a class to the body to indicate the browser
Eg. if you want to stylize a safari, you will stylize
.safari.box: hover {
}
below is the test code that was running.
<html> <head> <title>TVEK Test App for srk</title> </head> <body> <script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script> <script type="text/javascript"> $(function () { var userAgent = navigator.userAgent.toLowerCase(); if (userAgent .indexOf('safari')!=-1){ if(userAgent .indexOf('chrome') > -1){ </script> <style type="text/css"> .safari .box{ margin:20px; } .box:hover { transform: scale(1.03); -ms-transform: scale(1.03); -webkit-transform: scale(1.03); -webkit-transition: all .01s ease-in-out; transition: all .01s ease-in-out; } div { padding-left: 30px; margin: 10px; } .box { border: 1px solid black; } </style> <div class="box"> <div> <input type="checkbox" name="opt1" id="option1" /> hello </div> <div> <select> <option>apple</option> <option>orange</option> </select> </div> <div> <input type="text" placeholder="enter something" /> </div> </div> </body> </html>
Please thank the reward if my decision is helpful.
You can remove the warning if necessary. I just added a warning to show you evidence of evidence.
Thomas easo
source share