运行 ❯
获取你
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 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("img_nature.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">NATURE</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> <p><strong>Note:</strong> This example does not work in Internet Explorer or Edge.</p> </body> </html>