Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

现在有一个进度条,进度条中间有一串文字,当我的进度条覆盖了文字之后,文字要去进度条反色,怎么实现? #232

Open
Sunny-117 opened this issue Nov 4, 2022 · 1 comment

Comments

@Sunny-117
Copy link
Owner

No description provided.

@huccct
Copy link

huccct commented May 5, 2023

<!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>
      .progress-bar {
        position: relative;
        width: 200px;
        height: 20px;
        background-color: #f1f1f1;
      }

      .progress {
        position: absolute;
        top: 0;
        left: 0;
        width: 50%;
        height: 100%;
        background-color: #4caf50;
      }

      .text {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        color: #4caf50;
        mix-blend-mode: difference;
      }
    </style>
  </head>
  <body>
    <div class="progress-bar">
      <div class="progress"></div>
      <div class="text">Progress</div>
    </div>
  </body>
</html>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants