mix-blend-mode:设为difference即可,看看效果:
代码如下:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum=1.0,minimum=1.0,user-scalable=0" /> <title>BFW NEW PAGE</title> <style> body{ padding: 0; margin: 0; } .banner{ background: url("//repo.bfw.wiki/bfwrepo/image/65422df611d69.png"); background-repeat: no-repeat; background-size: cover; height: 100vh; } .title { font-size:100px; text-align: center; line-height: 100vh; color:white; margin: 0 auto; mix-blend-mode: difference; } </style> </head> <body> <div class="banner"> <h1 class="title">我是标题</h1> </div> </body> </html>
网友回复