Le 30 mars 2013 à 03:28, J.C. Berry <[email protected]> a écrit :

> I have the below link to a problem. I have an absolute page and container
> width, but I have a div inside the container that I need centered no matter
> how wide that contained div is. How can I make the contained div only as
> wide as its content and center it?
> 
> http://mindarc.com/capture.JPG


Assuming the following markup:
<div class="container">
        <div class="contained"> shrink-wrapping and centred</div>
</div>

Then display: table will do what you want, I think If I understand correctly - 
a simple html test case would be more useful than an image…):

.contained { display: table; margin: 1em auto; }


Philippe
--
Philippe Wittenbergh
http://l-c-n.com




______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to