Currently, I am facing a challenge in centering an (inline?) element horizontally within my container div. My goal is to have "some text" with a background that retracts to it, and to achieve this while keeping everything centered within the containing element. Although I understand that specifying a width would solve this issue, I am exploring other options.
Here's a basic example I created with some CSS that isn't working as intended... JSfiddle: http://jsfiddle.net/Mqw5R/ (works perfectly even without JavaScript!)
<div>
<p>Some text</p>
</div>
=========================
= =
= |some text| =
= =
=========================