CSS - How can I center a div within a div?
- by Spines
I have an outer div that is 800px wide. I have an inner div that could be anywhere from 200 to 600px wide.
I know how to center the inner div within the outer one if I set the inner one to have a specific width, but how do I center it since its a variable width?
Is there a way to set the div to only be the width of the elements inside of it, rather than having it expand to fill its containing div?