css - Heroku App not displaying same positioning/css as localhost
问题描述
I am having an issue with my locally hosted site having correct CSS/positioning but after it is deployed to Heroku it seems to lose some CSS. I am running mostly MERN Stack. I suspect it is going to be a problem relating to my node_modules but I have them in my git ignore and am not very knowledgable in that area. The best example I have is my About Us page. I've never encountered this issue and have found only info about Rails projects having this issue. I have tried uninstalling/re-installing bootstrap and added the CDN to the index.js file. Any help would be much appreciated.
Updated Deployed Site Screen Cap
Updated Locally Hosted Screen Cap
UPDATE: Found this CSS library is very helpful and helped fix my wonky CSS in production. https://meyerweb.com/eric/tools/css/reset/
解决方案
可能是你的缓存问题。
由于 VH(视口高度)属性,这可能是一个问题。它会根据屏幕高度而变化。
- 视口 = 浏览器窗口大小。如果视口宽 50 厘米,则 1vw = 0.5 厘米。
我刚刚看到你的代码,似乎你正在使用静态高度.about-wrapper
。
在您的情况下,您应该删除.about-wrapper
选择器的高度属性。
推荐阅读
- sql - 根据不同的表提取子字符串并在 SQL 中用它填充其他列
- xamarin - Xamarin.Forms TapGestureRecognizer 使用命令导航到基于单击的图像的页面
- php - 无法执行查询 mysqli(Strato 虚拟主机)
- amazon-web-services - 使用 wget 从 s3 获取文件
- reactjs - Apollo 客户端未解析 UserInputError
- angular - 下拉启用和禁用
- asp.net-core - 使用 Retrofit 发送多图像 - Android Studio
- ios - Twitter Api如何将unicode转换为字符串?
- flyway - 关于 FlywayDB 问题
- react-native - 根据 React Native 中的答案更改测验中按钮的颜色