I have 2 divs. One inside of another. The one on the outside has a width and height of 500px, and the one on the inside have a width of auto. I'm trying to center the div on the inside, but I'm also trying to get the width of it to be auto. It's not adjusting the width to auto, and instead it's spanning the entire 500px of the outer div. I'm not sure what I did wrong, so please take a look at my code:
<style>
#outer {
border: 1px solid black;
width: 500px;
height: 500px;
}
#inner {
border: 1px solid black;
width: auto;
margin: auto;
}
</style>
<div id = 'outer'>
<div id = 'inner'> Inner </div>
</div>