Home
CSS
CSS Z-index
Tryit: Using positioning and z-index
Run ❯
Get your
own
website
Result Size:
625 x 534
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <head> <style> img { position: absolute; left: 0px; top: 0px; z-index: -1; } </style> </head> <body> <h1>This is a heading</h1> <img src="img_tree.png"> <p>Because the image has a z-index of -1, it will be placed behind the text.</p> </body> </html>