<div></div>
@import url("https://fonts.googleapis.com/css2?family=Exo:wght@600&display=swap");
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
height: 100%;
}
body {
width: 100vw;
height: min(100vh, 100%);
font-family: "Exo", Arial, sans-serif;
background-color: #557;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
}
div {
width: 100%;
height: min(40vh, 100%);
--w: 760px;
--min-size: 600px;
--max-size: 100%;
background: #1f1b1c url(https://picsum.photos/1920/800) no-repeat center;
background-size: clamp(var(--min-size), var(--w) * 1000, var(--max-size)) auto;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.