Is it better to work with min-width or max-width in CSS layout?

Asked

Viewed 471 times

0

I’m creating some prototype responsive site. But what I noticed is that when I use min-width or max-width they do almost the same thing, although they determine a minimum width and a maximum I still think they do the same thing to some difference between the two to be able to use in the layout.

  • 2

    You know the difference between the concepts of "minimum" and "maximum"?

  • min-width:100px, the element will be at least 100px wide, but may be more dependent on the content inside. max-width:100px, if there is no content inside the element it gets to 0px wide, but if you put something inside it will grow to 100px max.... On the responsiveness of each and how to use them in @media see the duplicates. TB recommend you read on Mobile First https://www.todoespacoonline.com/w/2015/03/como-escrever-seu-css-para-projetos-mobile-first/

  • Thank you, thanks for the reply

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.