Having the floating children elements determine parent width

前端 未结 4 1557
春和景丽
春和景丽 2020-12-19 17:44

Here is an example

http://jsfiddle.net/BringMeAnother/LwXhE/

// html
4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-19 17:57

    Late to the party here, but all you really need is to add display: inline-block. And to center the .container div, just apply text-align: center to whatever contains it.

    JSFiddle: http://jsfiddle.net/LwXhE/24/

提交回复
热议问题