Safari does not support the :focus-within pseudo-class
P粉561438407
P粉561438407 2023-09-14 13:30:52
0
1
380

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    #my-button:focus-within {
      color: red;
    }
  </style>
</head>
<body>
  <button id="my-button" tabindex="0">item2</button>
</body>
</html>

When pressed, the color should switch to red. Works in Chrome and Firefox, always has issues with Safari (tested on version 15.6.1).

But what is the problem?

P粉561438407
P粉561438407

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!