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" />
<style>
.container {
position: relative;
width: 100%;
padding-top: 56.25%; /* 16:9 aspect ratio */
background-color: #eee;
}

.content {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 20px;
}

img {
max-width: 100%;
height: auto;
}

h2 {
margin-top: 10px;
font-size: 24px;
}