CSS: Width and Max-Width

后端 未结 9 1470
無奈伤痛
無奈伤痛 2020-12-02 18:01

Why does:

width: 98%;
max-width: 1140px;

do the same as

width: 1140px;
max-width: 98%;

The first one make

9条回答
  •  失恋的感觉
    2020-12-02 18:28

    Assuming that the container is your browser window, if you are on a 1280 px screen resolution then 98% would be 1254 px, which is still greater than 1140 px. So you see no difference. Try moving to lower resolution such as 1024px

提交回复
热议问题