I have a div whose width I'd like to be dynamic based off of text that is inside the div. I've found that this is possible by setting the div's display to inline-block; however, now I can't get the div to center with the display. I don't want to use text-align: center on the div or the html body as I do not want the text inside the div to be centered. I'm open to having this problem fixed with or without inline-block. As long as the div is centered and the div width is dynamic based off of the text, then I'm happy.
<div id="wrapper">
<p>Text that will change div width.</p>
</div>
#wrapper {
display: inline-block;
}