Hi, I would like to know if a div can be centered without width. due to two different versions of the container, depending on the language settings with different widths, I would like to center it dynamically.
margin: 0 auto;
not working without any width settings.
therefore the structure is simple:
<div id="container"> <div id="list"> <span class="up">text large</span> <ul class="navigation"> <li>one</li> <li>|</li> <li>two</li> <li>|</li> <li>three</li> <li>|</li> <li>four</li> </ul> </div> </div>
and css:
.wrapper
so if there is someone who knows how to deal with this, I would be very grateful.
Thank you very much.
UPDATE:
Thanks for answering this question. via:
display: inline-block;
this container, which needs to be centered, works great.
bonny source share