Home
HTML
HTML Images
Background images
Tryit: HTML background image cover entire document
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> body { background-image: url('img_girl.jpg'); background-repeat: no-repeat; background-attachment: fixed; background-size: cover; } </style> </head> <body> <h2>Background Cover</h2> <p>Set the background-size property to "cover" and the background image will cover the entire element, in this case the body element.</p> </body> </html>