Is there a way to center-align an item both vertically and horizontally with auto-generated width and height in CSS without relying on traditional methods like using top: 50%, left: 50%, transform: translate(-50%,-50%)?
CSS configuration without alignment properties
#container {
width: 200px;
height: 100px;
background-color: lightblue;
}
#myImage {
width: auto;
height: auto;
max-height: 100px;
max-width: 200px;
}