Make an image grow proportionately to specific limit

Asked

Viewed 44 times

1

Make an image grow proportionally to the limit of an area follow the example in the image below

inserir a descrição da imagem aqui

2 answers

1

max-width

div.imagem{
    width: 210px;
    height: 210px;
}

div.imagem img{
    width: 100%;
    max-width: 198px; // Sua Primeira Imagem
}

1

Use only the max-width property, as an example below:

div.imagem img{
 max-width:100%;// primeira imagem
}

You have already set the size of the area where the image will be inserted, so the image will occupy 100% of this area.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.