“CSS mantém a imagem da proporção” Respostas de código

CSS Mantenha a proporção de imagem

img {
  object-fit: cover;
  width: 100px;
  height:100px;
}
monospace

Mantenha a proporção de CSS de imagem

img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}
Mobile Star

Como definir o tamanho da imagem sem alterar a proporção de aspecto em CSS

img {
  display: block;
  max-width:230px;
  max-height:95px;
  width: auto;
  height: auto;
}
Zunayed

CSS mantém a imagem da proporção

.image-full {
    background: url(...some image...) no-repeat;
    background-size: cover;
    background-position: center center;
}
Breakable Batfish

Imagem HTML Manter proporção de aspecto

Don't set height AND width. Use one or the other and the correct aspect ratio will be maintained.
Delightful Duck

Respostas semelhantes a “CSS mantém a imagem da proporção”

Perguntas semelhantes a “CSS mantém a imagem da proporção”

Procure respostas de código populares por idioma

Procurar outros idiomas de código