更新时间:2023-11-30 19:56:58
您想要的内容类似于收缩包装. http://jsfiddle.net/e5Lkq/2/
What you want is similar to a shrink-wrap. http://jsfiddle.net/e5Lkq/2/
.outer { display: table }
要获得旧版IE支持,可以在 block
容器内使用 inline-block
(在默认的内联元素上).参见此和
To get old IE support, you can use inline-block
(on a by-default inline element) inside a block
container. See this and this (if you're really concerned about support). But I strongly encourage you to drop support (if you can). Is the extra 8% worth the effort? Also note that the percentages are different depending on the site.