开发者

CSS - min and max prefixes question

开发者 https://www.devze.com 2023-02-28 14:29 出处:网络
What exactl开发者_开发知识库y are the min and max prefixes in CSS? And are there any docs that explain them in detail?If you\'re talking about min-width and max-width (-height), they are not \"prefixe

What exactl开发者_开发知识库y are the min and max prefixes in CSS? And are there any docs that explain them in detail?


If you're talking about min-width and max-width (-height), they are not "prefixed". There are simply rules that are called min-width and max-width and also a rule that's called width. These are completely different rules that do different (albeit similar) things.

Perhaps see http://www.quirksmode.org/css/width.html and https://developer.mozilla.org/en/CSS_Reference.


For min-width, max-width, min-height and max-height, you can find details in the CSS 2.1 specification at http://www.w3.org/TR/CSS21/visudet.html#min-max-widths (description for height is a bit further down).

You might be interested by the algorithm description ("The following algorithm describes how the two properties influence the used value of the 'width' property:"). Basically, what seems to be going on is that a tentative width is computed ignoring the min-width and max-width properties. If it is larger than max-width, computation takes place again as if a width value of max-width had been specified. If the result is smaller than min-width, same thing with a width value equal to that of min-wdith.

0

精彩评论

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