html页面不论如何缩放也不改变布局的相对位置

在最外层div(父代)设置 最小宽度, 相对定位,弹性布局,在次一层的盒子(子代)设置 宽度。

body{
    min-width: 1200px;
    height: 2000px;
    /*background: lightblue;*/
    position: relative;
    display:flex;
    justify-content:center;
}
header{
	width:1200px;
}

  

posted @ 2022-05-12 18:01  孤傲白狼  阅读(538)  评论(0编辑  收藏  举报