我对所有内容都使用 %,因此我的网站在所有屏幕分辨率下都可以正常工作。然而,内容的位置放错了位置,并且因分辨率而异,因浏览器而异。我注意到并且可能与该问题有关的一件事是背景图像对缩放没有反应。然而,内容会使用react。
html {height: 200%; width: 100%;}
body { min-width: 99%; height: 100%; margin: 0; padding: 0; color: #969696; background-color: black; text-align: center; font-family: Arial; font-size: 100%; }
container {
position: relative; height: 100%; margin: auto; width: 85%; text-align: center; border: 1px solid red; background-image: url('images/bgmain.png'); background-repeat: no-repeat; background-size: 100% 100%; overflow: hidden; }
navbar {
position: relative; min-height: 2%; margin-top: 21%; margin-left: 2%; padding: 0 auto; width: 95%; text-align: center; overflow: hidden; }
例如,我的分辨率中的导航栏很好,而其他分辨率中的导航栏放错了位置。有什么错误吗?我想念什么吗?提前致谢。
最佳答案
CSS 样式的重置将有助于更好地控制您的样式。引用这个链接http://meyerweb.com/eric/tools/css/reset/还有这个http://developer.yahoo.com/yui/reset/还有这个http://sixrevisions.com/css/css-tips/css-tip-1-resetting-your-styles-with-css-reset/
关于css - 网站解析问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14929214/