开发者

Inline-block + min/max-width behavior

I see in many browsers (FF,Opera,Ie) that elements I give them "inline-block" and "min/max width" , their width is automatically sets to "min-width", and not max-width, as expected. Is that normal behavior?

Can I solve it in css way (inline-block el开发者_如何学Pythonement with max-width)? (I know about floats/tables/js, there are some reasons i need do it in this way)

here is the code


You are encountering a valid behavior. min-width means that the width cannot be less than the min-width value. On the other hand, max-width means that the width cannot exceed the max-width value (but it can be less). Thus if you specify both min-width and max-width on an empty element, its width is set to min-width.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜