Rails: Css appears to be different in dev and production

夙愿已清 提交于 2019-12-11 11:07:08

问题


i have a standard rails 4/heroku setup. One thing is weird: The different elements of the page appear in different sizes for the local environment and for the production environment.

For example: Although the header-height is set to a specific pixel value it is different in height for the two environments. Same with the width of the content: I set a max-width of 1260px - the width of the content is different for the two environments.

Everything appears bigger in production.

I found one related question, suggesting that the problem is due to assets which are compiled twice. Thats not the problem in my case...My CSS is loading differently between development and production environments

Whats the reason for this behaviour? Thanks in advance.


回答1:


Ok, i solved it now. Its embarrassing, but maybe it helps someone else: I activated the browser zoom for localhost unintentionally. The reason why i didn't come up with this from the beginning was, that also search boxes and other elements appeared in a different style - even without any styles! Search boxes without browser zoom have rounded corners in chrome. With browser zoom of -1, search boxes appear rectangular. This is why i thought there are still styles applied, even i disabled all my stylesheets facepalm.

Maybe someone else can save some time with this hint.



来源:https://stackoverflow.com/questions/26039102/rails-css-appears-to-be-different-in-dev-and-production

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!