Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the document</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> div.img-block { width: 100%; height: 450px; background-image: url("/uploads/media/default/0001/01/25acddb3da54207bc6beb5838f65f022feaa81d7.jpeg"); background-repeat: no-repeat; background-size: contain; border: 1px solid black; } h1 { padding: 0 10px; color: #fff; } </style> </head> <body> <p>Resize the browser window to see the effect.</p> <div class="img-block"> <h1>Your Background Image</h1> </div> </body> </html>