Can one of these bundles be used simultaneously in css? and in what cases?

  • width & min-width
  • width & max-width
  • height & min-height
  • height & max-height

in Chrome, if contradictory properties are spelled out - one of the properties is crossed out. And here (width & min-width) there is no both crossed out. Although the min-max-properties do not work, but only width works

PS Do not even ask the reason for the question))

  • one
    Yes, any of these bundles can be used at the same time, plus a variant of three properties, for example: min-height & height & max-height - this is normal - Grundy
  • one
    For some reason, these pairs are not used, although the min-max-properties do not work - an incomprehensible sentence - Grundy

1 answer 1

In practice, I often use two values ​​in adaptive layout when I need to set the width to 100% (percent), and the maximum width, for example, 600px. The point is that on small screens the block was full width and on large screens it was limited to 600px in order not to be stretched as the height was fixed and on large screens without maximum width the block would be distorted.

  • one
    Thank you very much, I probably just wanted to hear it! )) If there are still cases - I will be glad to know - Stanislav Sagan