如何解决Angular-CSS类在本地运行,但在服务器上托管应用程序后才运行
基于angular并使用内部和外部各种类库的应用程序。 一个类库- basscss ,可以在本地使用。
但是在服务器上托管后,basscss库被调用但未应用更改。因此会造成完全的未对准。
已按如下所示在angular.json下应用了它...
"styles": [
"node_modules/basscss/css/basscss-important.min.css"
],
例如-类 .mt3
调试后在本地显示
.mt3[_ngcontent-web-c42] {
margin-top: 2rem!important <!--by default striked off mark -->
margin-top: var (--space-3)!important
}
在服务器上以调试模式检查时
.mt3[_ngcontent-web-c42] {
margin-top: 2rem!important <!--by default striked off mark -->
margin-top: var (--space-3)!important <!-- this is applied by default but cant see it as computed in debugger -->
}
但是在服务器代码上,我取消选中margin-top: var (--space-3)!important
并选中/应用margin-top: 2rem!important
之后,页面正确对齐,否则未对齐。
简而言之,在服务器margin-top: var (--space-3)!important
上,这甚至没有被应用。
相反,margin-top: 2rem!important
可以在服务器上正常工作。
解决上述错误的任何方法..... 预先感谢
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。