源代碼
點擊運行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>教程</title> <style> img { position:absolute; left:0px; top:0px; z-index:-1; } </style> </head> <body> <h1>This is a heading</h1> <img src="/images/logo.png" width="100" height="140" /> <p>因為圖像元素設置了 z-index 屬性值為 -1, 所以它會顯示在文字之後。</p> </body> </html>
運行結果