源代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>编程字典</title> <style> img { position: absolute; left: 0px; top: 0px; z-index: -1; } h1{ color: #fff; } </style> </head> <body> <h1>这是一个标题</h1> <img src="logo.png" width="212" height="50"> <p>因为图像的z-index是1,所以它将被放置在文本之上.</p> </body> </html>
运行结果