Matthias Apsel: Rahmen um automatisch skaliertes Bild

Beitrag lesen

Hallo Raketenwilli, hallo Stefan

div {
  height: calc(100vh - 200px);
  width: calc(100vw - 200px);
  margin-top: 100px;
  margin-left: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
}

img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: blue;
  border: medium solid red;
  padding: 1rem;
}

Bis demnächst
Matthias

--
Du kannst das Projekt SELFHTML unterstützen,
indem du bei Amazon-Einkäufen Amazon smile (Was ist das?) nutzt.