如果我添加以下css
html,body{
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow-x: hidden;
}
这将解决空白区问题,但它将删除水平滚动条,无论窗口大小如何,它都应用100%宽度,但我的网站包含固定宽度。我能在这做什么?
答案 0 :(得分:0)
使用min-width
来实现您的目标。
对于实例,
html,body{
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow-x: hidden;
min-width:xxpx; /* enter a pixel value more than 1px that distorts the layout on resize */
}
PS: xxpx是代表值。使用适合您解决问题的价值。