全屏
  <figure class="container">
      <img src="04eadd2b-7dd4-43fc-af3d-cff948811986_balloons.jpg.webp" alt="balloons">
      <figcaption>Balloons</figcaption>
    </figure>
/* Copyright 2018 Google LLC.
SPDX-License-Identifier: Apache-2.0 */

/* CSS files add styling rules to your content */

body {
  font-family: "Benton Sans", "Helvetica Neue", helvetica, arial, sans-serif;
  margin: 2em;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: 400px;
  hight: 300px;
  margin: 1em auto;
  position: relative;
  border:1px solid #ccc;
  
}

.container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-mask-image: linear-gradient(to top, transparent 5%, black 100%);
  mask-image: linear-gradient(to top, transparent 5%, black 100%);*/
} 

.container figcaption {
  position: absolute;
  bottom: 1em;
  right: 1em;
  font-size: 150%;
  color: #333;
}
返回