<!DOCTYPE html> <html> <head> <style> .container { position: relative; } .center { position: absolute; top: 50%; width: 100%; text-align: center; font-size: 18px; } img { width: 100%; height: auto; opacity: 0.3; } </style> </head> <body> <h1>图像文本</h1> <p>居中图像中的文本:</p> <div class="container"> <img src="/static/demo/images/logo-2.png" alt="(www.sou-xun.com)" width="800" height="450"> <div class="center">Centered</div> </div> </body> </html>