<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> div { 100px; height: 100px; background: url('test.jpg'); -webkit-background-clip: text; font-size: 30px; color: transparent; } </style> <title>Document</title> </head> <body> <div>Lorem</div> </body> </html>
效果图: