Source Code: (back to article)
<!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-size: 100% 100%;
border: 1px solid black;
}
h2 {
padding: 0 10px;
color: #fff;
}
</style>
</head>
<body>
<p>Resize the browser window to see the effect.</p>
<div class="img-block">
<h2>
Your background Image
</h2>
</div>
</body>
</html>