Why doesn't max-width override min-width?

后端 未结 2 490
粉色の甜心
粉色の甜心 2021-01-01 08:52

I\'m trying to create a responsive layout in which two boxes sit next to each other if the screen size allows it, and have them below each other if it doesn\'t. If the boxes

2条回答
  •  情话喂你
    2021-01-01 09:44

    I know, I'm late ... But one exact solution could be this:

    p {
        display: inline-block;
        font-size: 15px;
        text-align: left;
        width: 50%;
        border: 1px solid blue;
        min-width: 350px;
    }
    @media (max-width: 700px) {
      p {
        width:100%;
        display:block;
      }
    }
    

提交回复
热议问题