<!DOCTYPE html>
<html lang="en">

  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <div id="wrapper">
    <h1 id="title">Picture Tag</h1>

      <source media="(min-width: 400px)" srcset="https://picsum.photos/id/1049/400/240.jpg">
      <source media="(min-width: 600px)" srcset="https://picsum.photos/id/1010/400/240.jpg">
      <img src="https://picsum.photos/id/1083/400/240.jpg" alt="" />
    <p>resize window to see the effect</p>

@import url("https://fonts.googleapis.com/css2?family=Montserrat&display=swap");

* {
  padding: 0;
  margin: 0;
  box-sizing: border: box;

body {
  background-image: linear-gradient(
    to right,
    #f78ca0 0%,
    #f9748f 19%,
    #fd868c 60%,
    #fe9a8b 100%
  background-attachment: fixed;
  height: 100vh;
  display: grid;
  justify-content: center;
  align-content: center;
  grid-template-columns: minmax(150px, 440px);
  font-family: "Montserrat", sans-serif;

#wrapper {
  text-align: center;
  padding: 20px;

#title {
  margin-bottom: 20px;

img {
  border: 5px solid white;
  border-radius: 5px;
  width: 100%;

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.