1
I’m having a hard time creating an image that stays inside a div, maintaining its proportions. But the div has a standard size and cannot exceed this limit size.
Below I leave an image that illustrates what is my intention:
Below is the css code I made, the image continues in its patterns, but is not limited in the div, often exceeding the desired size that fits on the screen:
#div{
padding-top: 20px;
padding-bottom: 20px;
width: 50%;
height: auto ;
}
#imagem{
width: auto;
height: auto;
top: 5%;
left: 26%;
}
Maybe the code is meaningless because I’m programming web for a short time.
Thank you very much, you helped me a lot.
– Samuel Brati Favarin