I have a div container with an img inside of it:
<div id='triangle'>
<img src='/static/triangle.png' style='position: absolute; height: 100%; width: 100%'>
</div>
How would I resize the div to a height of 500px and keep the aspect ratio? I have tried:
#triangle
{
position: absolute;
height: 500px;
width: auto;
}
but it does not work: Alternatively:
#triangle
{
position: absolute;
max-height: 500px;
max-width: 500px;
}
Creates a div of 500x0 px.