运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> body {font-family: Arial, Helvetica, sans-serif;} .image-container { background-image: url("paris.jpg"); background-size: cover; position: relative; height: 300px; } .text { background-color: white; color: black; font-size: 10vw; font-weight: bold; margin: 0 auto; padding: 10px; width: 50%; text-align: center; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); mix-blend-mode: screen; } </style> </head> <body> <h2>Responsive Cutout Text Effect</h2> <div class="image-container"> <div class="text">PARIS</div> </div> <p>This example creates a responsive cutout text/knockout text - text that appears cut out on top of a background image.</p> <p>Resize the browser window to see the responsive effect.</p> </body> </html>