如何在下面的简单css中解决跨浏览器中的高度和边距问题。在internet explorer和Firefox中,div元素的高度大于根据屏幕尺寸指定的高度,并且页眉到其他div元素或页脚到其他元素之间的边距也是不均匀的。**或任何我更深入了解解决方案的网站参考表单**。提前感谢
@media screen and (max-width: 480px)
{
html ,body
{
width : 100% ;
height :100% ;
font-size : 1rem ;
}
.header ,.footer
{
display : table-row;
background : white ;
height : 10% ;
width : 100% ;
overflow : auto ;
}
.left
{
display : table-row;
background : red ;
height : 26.66666666666667%;
width : 100% ;
overflow : auto;
}
.center
{
display : table-row;
background :blue ;
height : 26.66666666666667%;
width : 100% ;
overflow :auto ;
}
.right
{
display : table-row;
background : gray ;
height : 26.66666666666667%;
width : 100% ;
overflow : auto ;
}
}
发布于 2016-10-06 13:47:14
要解决大多数CSS跨浏览器问题,请尝试使用CSS重置。您可以从here获取最新版本。
我推荐你使用normalize.css,因为我以前用过它,它非常适合解决这类问题。但是测试所有这些,并检查哪一个可以满足您的需求。
https://stackoverflow.com/questions/39888107
复制相似问题