开发者

center contents of float:left

I want to center the contents of a div that is floated to the left, (incidentally, the contents of this div is other containers that are floated to the left)

See http://jsfiddle.net/KgH8c/ for an exa开发者_开发技巧mple.

I cannot use inline-block due to that not working in IE.

Are there any other solutions?

Thanks, Wesley


I cannot use inline-block due to that not working in IE.

That's not entirely true. It works completely in IE8 and greater. In IE6/7, it only works on naturally inline elements. Fortunately, there's a really easy way to fix it (to work on for example, divs):

.inline-block {
    display: inline-block;
    *display: inline;
    zoom: 1
}

See: http://jsfiddle.net/thirtydot/KgH8c/1/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜